diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml index 852d22462138e6..c63d470643a79c 100644 --- a/.github/workflows/bloat_check.yaml +++ b/.github/workflows/bloat_check.yaml @@ -37,16 +37,10 @@ jobs: uses: actions/checkout@v2 - name: Report - run: | - scripts/helpers/bloat_check.py \ - --github-repository project-chip/connectedhomeip \ - --github-api-token "${{ secrets.GITHUB_TOKEN }}" - - - name: Report2 run: | scripts/tools/memory/gh_report.py \ --verbose \ - --report-increases 1 \ + --report-increases 0.2 \ --report-pr \ --github-comment \ --github-limit-artifact-pages 50 \ diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 2c2dcc9ae24b3c..41fb59106139c8 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -41,7 +41,6 @@ jobs: image: connectedhomeip/chip-build-efr32:latest volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - - "/tmp/output_binaries:/tmp/output_binaries" steps: - name: Checkout uses: actions/checkout@v2 @@ -83,26 +82,6 @@ jobs: scripts/examples/gn_efr32_example.sh examples/window-app/efr32/ out/window_app_debug BRD4161A .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py efr32 BRD4161A window-app \ out/window_app_debug/BRD4161A/chip-efr32-window-example.out /tmp/bloat_reports/ - - name: Binary artifact suffix - id: outsuffix - uses: haya14busa/action-cond@v1.0.0 - if: ${{ !env.ACT }} - with: - cond: ${{ github.event.pull_request.number == '' }} - if_true: "${{ github.sha }}" - if_false: "pull-${{ github.event.pull_request.number }}" - - name: Uploading Binaries - uses: actions/upload-artifact@v2 - if: ${{ !env.ACT }} - with: - name: - ${{ env.BUILD_TYPE }}-example-build-${{ - steps.outsuffix.outputs.value }} - path: | - out/lock_app_debug/BRD4161A/chip-efr32-lock-example.out - out/lock_app_debug/BRD4161A/chip-efr32-lock-example.out.map - out/lighting_app_debug_rpc/BRD4161A/chip-efr32-lighting-example.out - out/lighting_app_debug_rpc/BRD4161A/chip-efr32-lighting-example.out.map - name: Uploading Size Reports uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index 865efddb8e6d95..bcbb30346f331f 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -41,7 +41,6 @@ jobs: image: connectedhomeip/chip-build-esp32:latest volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - - "/tmp/output_binaries:/tmp/output_binaries" steps: - name: Checkout @@ -104,25 +103,6 @@ jobs: - name: Build example IPv6 Only App timeout-minutes: 10 run: scripts/examples/esp_example.sh ipv6only-app sdkconfig.defaults - - name: Binary artifact suffix - id: outsuffix - uses: haya14busa/action-cond@v1.0.0 - if: ${{ !env.ACT }} - with: - cond: ${{ github.event.pull_request.number == '' }} - if_true: "${{ github.sha }}" - if_false: "pull-${{ github.event.pull_request.number }}" - - name: Copy aside bloat report & binaries - run: | - cp -r example_binaries/$BUILD_TYPE-build /tmp/output_binaries/ - - name: Uploading Binaries - uses: actions/upload-artifact@v2 - if: ${{ !env.ACT }} - with: - name: - ${{ env.BUILD_TYPE }}-example-build-${{ - steps.outsuffix.outputs.value }} - path: /tmp/output_binaries/${{ env.BUILD_TYPE }}-build - name: Uploading Size Reports uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml index 847e89bfae35bc..f3a8d57dd948d1 100644 --- a/.github/workflows/examples-k32w.yaml +++ b/.github/workflows/examples-k32w.yaml @@ -40,7 +40,6 @@ jobs: image: connectedhomeip/chip-build-k32w:latest volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - - "/tmp/output_binaries:/tmp/output_binaries" steps: - name: Checkout uses: actions/checkout@v2 @@ -84,24 +83,6 @@ jobs: k32w k32w061+se05x+release lighting-app \ out/lighting_app_se_release/chip-k32w061-light-example \ /tmp/bloat_reports/ - - name: Binary artifact suffix - id: outsuffix - uses: haya14busa/action-cond@v1.0.0 - if: ${{ !env.ACT }} - with: - cond: ${{ github.event.pull_request.number == '' }} - if_true: "${{ github.sha }}" - if_false: "pull-${{ github.event.pull_request.number }}" - - name: Uploading Binaries - uses: actions/upload-artifact@v2 - if: ${{ !env.ACT }} - with: - name: - ${{ env.BUILD_TYPE }}-example-build-${{ - steps.outsuffix.outputs.value }} - path: | - out/lock_app_debug/chip-k32w061-lock-example.out - out/lock_app_debug/chip-k32w061-lock-example.out.map - name: Uploading Size Reports uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index 5e7bf60301cf3b..ad7ab13cba9fc5 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -40,7 +40,6 @@ jobs: image: connectedhomeip/chip-build:0.5.22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - - "/tmp/output_binaries:/tmp/output_binaries" steps: - name: Checkout @@ -124,24 +123,6 @@ jobs: linux debug ota-requestor-app \ out/ota_requestor_debug/chip-ota-requestor-app \ /tmp/bloat_reports/ - - name: Binary artifact suffix - id: outsuffix - uses: haya14busa/action-cond@v1.0.0 - if: ${{ !env.ACT }} - with: - cond: ${{ github.event.pull_request.number == '' }} - if_true: "${{ github.sha }}" - if_false: "pull-${{ github.event.pull_request.number }}" - - name: Uploading Binaries - uses: actions/upload-artifact@v2 - if: ${{ !env.ACT }} - with: - name: - ${{ env.BUILD_TYPE }}-example-build-${{ - steps.outsuffix.outputs.value }} - path: | - out/all_clusters_debug/all-clusters-server - out/all_clusters_debug/all-clusters-server.map - name: Uploading Size Reports uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index 0c8a96c0b1aea0..247cd80f090548 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -43,7 +43,6 @@ jobs: image: connectedhomeip/chip-build-mbed-os:0.5.22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - - "/tmp/output_binaries:/tmp/output_binaries" steps: - name: Checkout @@ -104,34 +103,6 @@ jobs: timeout-minutes: 10 run: scripts/tests/mbed/mbed_unit_tests.sh -b=$APP_TARGET -p=$APP_PROFILE - - name: Copy aside build products - run: | - mkdir -p /tmp/output_binaries/$BUILD_TYPE-build - cp examples/lock-app/mbed/build-$APP_TARGET/$APP_PROFILE/chip-mbed-lock-app-example.hex \ - /tmp/output_binaries/$BUILD_TYPE-build/lock-app-$APP_TARGET-$APP_PROFILE.hex - cp examples/lighting-app/mbed/build-$APP_TARGET/$APP_PROFILE/chip-mbed-lighting-app-example.hex \ - /tmp/output_binaries/$BUILD_TYPE-build/lighting-app-$APP_TARGET-$APP_PROFILE.hex - cp examples/all-clusters-app/mbed/build-$APP_TARGET/$APP_PROFILE/chip-mbed-all-clusters-app-example.hex \ - /tmp/output_binaries/$BUILD_TYPE-build/all-clusters-app-$APP_TARGET-$APP_PROFILE.hex - - - name: Binary artifacts suffix - id: outsuffix - uses: haya14busa/action-cond@v1.0.0 - if: ${{ !env.ACT }} - with: - cond: ${{ github.event.pull_request.number == '' }} - if_true: "${{ github.sha }}" - if_false: "pull-${{ github.event.pull_request.number }}" - - - name: Uploading binaries as artifacts - uses: actions/upload-artifact@v2 - if: ${{ !env.ACT }} - with: - name: - ${{ env.BUILD_TYPE }}-binaries-${{ env.APP_TARGET }}-${{ env.APP_PROFILE }}-build-${{ - steps.outsuffix.outputs.value }} - path: /tmp/output_binaries/${{ env.BUILD_TYPE }}-build - - name: Uploading Size Reports uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 4238612e8cc87b..1eeb017ba1e39f 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -40,7 +40,6 @@ jobs: image: connectedhomeip/chip-build-nrf-platform:0.5.22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - - "/tmp/output_binaries:/tmp/output_binaries" steps: - name: Checkout @@ -145,29 +144,6 @@ jobs: timeout-minutes: 10 run: | scripts/run_in_build_env.sh "scripts/tests/nrfconnect_native_posix_tests.sh native_posix_64" - - name: Copy aside build products - run: | - mkdir -p /tmp/output_binaries/$BUILD_TYPE-build - cp examples/lock-app/nrfconnect/build/nrf52840dk_nrf52840/zephyr/zephyr.elf \ - /tmp/output_binaries/$BUILD_TYPE-build/chip-lock.elf - cp examples/shell/nrfconnect/build/nrf52840dk_nrf52840/zephyr/zephyr.elf \ - /tmp/output_binaries/$BUILD_TYPE-build/chip-shell.elf - - name: Binary artifact suffix - id: outsuffix - uses: haya14busa/action-cond@v1.0.0 - if: ${{ !env.ACT }} - with: - cond: ${{ github.event.pull_request.number == '' }} - if_true: "${{ github.sha }}" - if_false: "pull-${{ github.event.pull_request.number }}" - - name: Uploading Binaries - uses: actions/upload-artifact@v2 - if: ${{ !env.ACT }} - with: - name: - ${{ env.BUILD_TYPE }}-example-build-${{ - steps.outsuffix.outputs.value }} - path: /tmp/output_binaries/${{ env.BUILD_TYPE }}-build - name: Uploading Size Reports uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index 4a21cb8bfa1932..2f8127d3e97ba4 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -40,7 +40,6 @@ jobs: image: connectedhomeip/chip-build:0.5.22 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - - "/tmp/output_binaries:/tmp/output_binaries" steps: - name: Checkout uses: actions/checkout@v2 @@ -86,24 +85,6 @@ jobs: timeout-minutes: 5 run: | config/qpg/chip-gn/build.sh - - name: Binary artifact suffix - id: outsuffix - uses: haya14busa/action-cond@v1.0.0 - if: ${{ !env.ACT }} - with: - cond: ${{ github.event.pull_request.number == '' }} - if_true: "${{ github.sha }}" - if_false: "pull-${{ github.event.pull_request.number }}" - - name: Uploading Binaries - uses: actions/upload-artifact@v2 - if: ${{ !env.ACT }} - with: - name: - ${{ env.BUILD_TYPE }}-example-build-${{ - steps.outsuffix.outputs.value }} - path: | - out/lighting_app_debug/chip-qpg6100-lighting-example.out - out/lighting_app_debug/chip-qpg6100-lighting-example.out.map - name: Uploading Size Reports uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml index ba344f12314e9c..117acc8933a584 100644 --- a/.github/workflows/zap_regeneration.yaml +++ b/.github/workflows/zap_regeneration.yaml @@ -16,40 +16,58 @@ name: ZAP - Regenerate on: workflow_dispatch: - issue_comment: - types: [created] concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true jobs: - zap_regenerate: - name: ZAP - Regenerate + zap_regeneration: + name: ZAP Regeneration timeout-minutes: 60 runs-on: ubuntu-18.04 - if: (github.event.issue.pull_request != '' && contains(github.event.comment.body, '/regenerate')) || (github.event_name == 'workflow_dispatch') + if: github.actor != 'restyled-io[bot]' steps: - - name: Checkout the latest code - uses: actions/checkout@v2 - with: - token: ${{ secrets.APPLE_PERSONAL_ACCESS_TOKEN }} - fetch-depth: 0 # otherwise, you will fail to push refs to dest repo - - name: Use Node.js 14.x - uses: actions/setup-node@v2 - with: - node-version: '14' - - name: Use Java - uses: actions/setup-java@v2 - with: - distribution: 'zulu' - java-version: '11' - java-package: jre - - run: sudo apt-get update - - run: sudo apt-get install -fy --fix-missing libpixman-1-dev libcairo-dev libsdl-pango-dev libjpeg-dev libgif-dev python-autopep8 - - name: Rebase and regenerate - run: scripts/helpers/rebase_and_regenerate_zap.sh - env: - GITHUB_TOKEN: ${{ secrets.APPLE_PERSONAL_ACCESS_TOKEN }} + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: '14.x' + - name: Use Java + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '11' + java-package: jre + - run: sudo apt-get update + - run: sudo apt-get install --fix-missing libpixman-1-dev libcairo-dev libsdl-pango-dev libjpeg-dev libgif-dev python-autopep8 + - name: Setup ZAP + timeout-minutes: 5 + run: | + cd third_party/zap/repo/ + npm ci + npm run version-stamp + npm rebuild canvas --update-binary + npm run build-spa + - name: Generate all + timeout-minutes: 5 + run: scripts/tools/zap_regen_all.py + - name: Add uncommitted changes + run: git add . + - name: Fix upstream + run: | + git remote set-url origin https://x-access-token:$COMMITTER_TOKEN@github.com/$GITHUB_REPOSITORY.git + git config --global user.email "$USER_EMAIL" + git config --global user.name "$USER_NAME" + env: + COMMITTER_TOKEN: ${{ secrets.MATTER_PAT }} + USER_EMAIL: ${{ secrets.MATTER_PAT_EMAIL }} + USER_NAME: ${{ secrets.MATTER_PAT_NAME }} + GITHUB_REPOSITORY: ${{ github.GITHUB_REPOSITORY }} + - name: Push + run: git push diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml index 0ab784d0c36815..008d696457df00 100644 --- a/.github/workflows/zap_templates.yaml +++ b/.github/workflows/zap_templates.yaml @@ -61,5 +61,9 @@ jobs: - name: Check for uncommited changes run: | git add . - git diff-index HEAD -- - git diff-index --quiet HEAD -- + # Show the full diff + git diff-index -p HEAD -- + # Also show just the files that are different, to make it easy + # to tell at a glance what might be going on. And throw in + # --exit-code to make this job fail if there is a difference. + git diff-index --exit-code HEAD -- diff --git a/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8001-8002-WithDACOrigin.der b/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8001-8002-WithDACOrigin.der new file mode 100644 index 00000000000000..592e313424b9cb Binary files /dev/null and b/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8001-8002-WithDACOrigin.der differ diff --git a/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8001-8002.der b/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8001-8002.der new file mode 100644 index 00000000000000..47a8df5479c67d Binary files /dev/null and b/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8001-8002.der differ diff --git a/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8001.der b/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8001.der new file mode 100644 index 00000000000000..a3c84e7e877606 Binary files /dev/null and b/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8001.der differ diff --git a/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8002-WithDACOrigin.der b/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8002-WithDACOrigin.der new file mode 100644 index 00000000000000..7239d6571749a1 Binary files /dev/null and b/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8002-WithDACOrigin.der differ diff --git a/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8002.der b/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8002.der new file mode 100644 index 00000000000000..756e4952001d60 Binary files /dev/null and b/credentials/test/certification-declaration/Chip-Test-CD-FFF2-8002.der differ diff --git a/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8001-8002-WithDACOrigin.der b/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8001-8002-WithDACOrigin.der new file mode 100644 index 00000000000000..ab996e631f47aa Binary files /dev/null and b/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8001-8002-WithDACOrigin.der differ diff --git a/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8001-8002.der b/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8001-8002.der new file mode 100644 index 00000000000000..a2b7c28121200a Binary files /dev/null and b/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8001-8002.der differ diff --git a/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8001.der b/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8001.der new file mode 100644 index 00000000000000..396ca754da3cc6 Binary files /dev/null and b/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8001.der differ diff --git a/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8002-WithDACOrigin.der b/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8002-WithDACOrigin.der new file mode 100644 index 00000000000000..83b0b122428858 Binary files /dev/null and b/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8002-WithDACOrigin.der differ diff --git a/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8002.der b/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8002.der new file mode 100644 index 00000000000000..2992009dad063b Binary files /dev/null and b/credentials/test/certification-declaration/Chip-Test-CD-FFF3-8002.der differ diff --git a/credentials/test/certification-declaration/Chip-Test-CD-Signing-Cert.pem b/credentials/test/certification-declaration/Chip-Test-CD-Signing-Cert.pem new file mode 100644 index 00000000000000..0392cd2b6a5dd6 --- /dev/null +++ b/credentials/test/certification-declaration/Chip-Test-CD-Signing-Cert.pem @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIBszCCAVqgAwIBAgIIRdrzneR6oI8wCgYIKoZIzj0EAwIwKzEpMCcGA1UEAwwg +TWF0dGVyIFRlc3QgQ0QgU2lnbmluZyBBdXRob3JpdHkwIBcNMjEwNjI4MTQyMzQz +WhgPOTk5OTEyMzEyMzU5NTlaMCsxKTAnBgNVBAMMIE1hdHRlciBUZXN0IENEIFNp +Z25pbmcgQXV0aG9yaXR5MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPDmJIkUr +VcrzicJb0bykZWlSzLkOiGkkmthHRlMBTL+V1oeWXgNrUhxRA35rjO3vyh60QEZp +T6CIgu7WUZ3suqNmMGQwEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFGL6gjNZrPqplj4c+hQK3fUE83FgMB8GA1UdIwQYMBaAFGL6 +gjNZrPqplj4c+hQK3fUE83FgMAoGCCqGSM49BAMCA0cAMEQCICxUXOTkV9im8NnZ +u+vW7OHd/n+MbZps83UyH8b6xxOEAiBUB3jodDlyUn7t669YaGIgtUB48s1OYqdq +58u5L/VMiw== +-----END CERTIFICATE----- diff --git a/credentials/test/certification-declaration/Chip-Test-CD-Signing-Key.pem b/credentials/test/certification-declaration/Chip-Test-CD-Signing-Key.pem new file mode 100644 index 00000000000000..fcf844d3ee0920 --- /dev/null +++ b/credentials/test/certification-declaration/Chip-Test-CD-Signing-Key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIK7zSEEW6UgexXvgRy30G/SZBk5QJK2GnspeiJgC1IB1oAoGCCqGSM49 +AwEHoUQDQgAEPDmJIkUrVcrzicJb0bykZWlSzLkOiGkkmthHRlMBTL+V1oeWXgNr +UhxRA35rjO3vyh60QEZpT6CIgu7WUZ3sug== +-----END EC PRIVATE KEY----- diff --git a/credentials/test/gen-test-cds.sh b/credentials/test/gen-test-cds.sh new file mode 100755 index 00000000000000..79264da118c512 --- /dev/null +++ b/credentials/test/gen-test-cds.sh @@ -0,0 +1,84 @@ +#!/usr/bin/env bash + +# +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Script that can be used to generate Certification Declaration (CD) +# for testing purposes. +# The script expects the path to the chip-cert tool binary as an input argument. +# +# Usage example when the script is run from the CHIP SDK root directory: +# ./credentials/test/gen-test-cds.sh ./out/debug/standalone/chip-cert +# +# The result will be stored in: +# credentials/test/certification-declaration +# +# If the intention is to re-generate a new set of CDs that replace the already +# present ones then it is recommended to clear the folder: +# rm credentials/test/certification-declaration/* +# + +set -e + +here=${0%/*} + +dest_dir="$here/certification-declaration" + +mkdir -p "$dest_dir" + +if [ $# == 1 ]; then + chip_cert_tool=$1 +else + echo "Error: Please specify exactly one input argument; the path to the chip-cert tool binary" + exit +fi + +cert_valid_from="2021-06-28 14:23:43" +cert_lifetime=4294967295 + +format_version=1 +vids=(FFF2 FFF3) +pid0=8001 +pid1=8002 +device_type_id=0x1234 +certificate_id0="ZIG20141ZB330001-24" +certificate_id1="ZIG20142ZB330002-24" +security_level=0 +security_info=0 +version_num=9876 +certification_type=0 +dac_origin_vendor_id=0xFFF1 +dac_origin_product_id=0x8000 + +cd_signing_key="$dest_dir/Chip-Test-CD-Signing-Key.pem" +cd_signing_cert="$dest_dir/Chip-Test-CD-Signing-Cert.pem" + +# Using gen-att-cert command to generate CD Signing Cert/Key: +"$chip_cert_tool" gen-att-cert --type a --subject-cn "Matter Test CD Signing Authority" --valid-from "$cert_valid_from" --lifetime "$cert_lifetime" --out-key "$cd_signing_key" --out "$cd_signing_cert" + +for vid in "${vids[@]}"; do + + "$chip_cert_tool" gen-cd --key "$cd_signing_key" --cert "$cd_signing_cert" --out "$dest_dir/Chip-Test-CD-$vid-$pid0.der" --format-version "$format_version" --vendor-id "0x$vid" --product-id "0x$pid0" --device-type-id "$device_type_id" --certificate-id "$certificate_id0" --security-level "$security_level" --security-info "$security_info" --version-number "$version_num" --certification-type "$certification_type" + + "$chip_cert_tool" gen-cd --key "$cd_signing_key" --cert "$cd_signing_cert" --out "$dest_dir/Chip-Test-CD-$vid-$pid1.der" --format-version "$format_version" --vendor-id "0x$vid" --product-id "0x$pid1" --device-type-id "$device_type_id" --certificate-id "$certificate_id1" --security-level "$security_level" --security-info "$security_info" --version-number "$version_num" --certification-type "$certification_type" + + "$chip_cert_tool" gen-cd --key "$cd_signing_key" --cert "$cd_signing_cert" --out "$dest_dir/Chip-Test-CD-$vid-$pid1-WithDACOrigin.der" --format-version "$format_version" --vendor-id "0x$vid" --product-id "0x$pid1" --device-type-id "$device_type_id" --certificate-id "$certificate_id1" --security-level "$security_level" --security-info "$security_info" --version-number "$version_num" --certification-type "$certification_type" --dac-origin-vendor-id "$dac_origin_vendor_id" --dac-origin-product-id "$dac_origin_product_id" + + "$chip_cert_tool" gen-cd --key "$cd_signing_key" --cert "$cd_signing_cert" --out "$dest_dir/Chip-Test-CD-$vid-$pid0-$pid1.der" --format-version "$format_version" --vendor-id "0x$vid" --product-id "0x$pid0" --product-id "0x$pid1" --device-type-id "$device_type_id" --certificate-id "$certificate_id1" --security-level "$security_level" --security-info "$security_info" --version-number "$version_num" --certification-type "$certification_type" + + "$chip_cert_tool" gen-cd --key "$cd_signing_key" --cert "$cd_signing_cert" --out "$dest_dir/Chip-Test-CD-$vid-$pid0-$pid1-WithDACOrigin.der" --format-version "$format_version" --vendor-id "0x$vid" --product-id "0x$pid0" --product-id "0x$pid1" --device-type-id "$device_type_id" --certificate-id "$certificate_id1" --security-level "$security_level" --security-info "$security_info" --version-number "$version_num" --certification-type "$certification_type" --dac-origin-vendor-id "$dac_origin_vendor_id" --dac-origin-product-id "$dac_origin_product_id" + +done diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index c126624fbf0e62..ea2e054fda1f06 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -59,6 +59,14 @@ "source": "client", "incoming": 1, "outgoing": 1 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 } ], "attributes": [ @@ -5698,7 +5706,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -5713,7 +5721,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -5728,7 +5736,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -5743,7 +5751,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -6689,6 +6697,14 @@ "source": "client", "incoming": 1, "outgoing": 1 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 } ], "attributes": [ @@ -10408,6 +10424,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -11269,6 +11300,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "min setpoint dead band", + "code": 25, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x19", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "control sequence of operation", "code": 27, @@ -12636,7 +12682,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -12651,7 +12697,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -12666,7 +12712,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -12681,11 +12727,11 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -12748,7 +12794,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -12763,7 +12809,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -12778,7 +12824,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -12793,7 +12839,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -12808,7 +12854,7 @@ "reportableChange": 0 }, { - "name": "scaled value", + "name": "ScaledValue", "code": 16, "mfgCode": null, "side": "server", @@ -12823,7 +12869,7 @@ "reportableChange": 0 }, { - "name": "scaled tolerance", + "name": "ScaledTolerance", "code": 19, "mfgCode": null, "side": "server", @@ -12890,7 +12936,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -12905,7 +12951,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -12920,7 +12966,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -12934,6 +12980,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -13036,7 +13097,7 @@ "code": 3, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -14860,6 +14921,14 @@ "source": "client", "incoming": 1, "outgoing": 0 + }, + { + "name": "TestNullableOptionalRequest", + "code": 15, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 } ], "attributes": [ @@ -14919,6 +14988,14 @@ "source": "server", "incoming": 0, "outgoing": 1 + }, + { + "name": "TestNullableOptionalResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 } ], "attributes": [ @@ -18572,7 +18649,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -18587,7 +18664,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -18602,7 +18679,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -18617,7 +18694,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -18929,6 +19006,5 @@ "endpointVersion": null, "deviceIdentifier": null } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/all-clusters-app/ameba/main/chipinterface.cpp b/examples/all-clusters-app/ameba/main/chipinterface.cpp index 868cce0388daa9..ebd31e945128f8 100644 --- a/examples/all-clusters-app/ameba/main/chipinterface.cpp +++ b/examples/all-clusters-app/ameba/main/chipinterface.cpp @@ -4,6 +4,7 @@ #include "DeviceCallbacks.h" #include "Server.h" +#include #include #include @@ -15,6 +16,20 @@ using namespace ::chip; using namespace ::chip::DeviceManager; using namespace ::chip::DeviceLayer; +Identify gIdentify0 = { + chip::EndpointId{ 0 }, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); }, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); }, + EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, +}; + +Identify gIdentify1 = { + chip::EndpointId{ 1 }, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); }, + [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); }, + EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, +}; + static DeviceCallbacks EchoCallbacks; extern "C" void ChipTest(void) diff --git a/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults b/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults index 9400bd0866fc49..2da74647c0f5fc 100644 --- a/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults +++ b/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults @@ -53,4 +53,7 @@ CONFIG_EXAMPLE_UART_PORT_NUM=0 CONFIG_EXAMPLE_UART_BAUD_RATE=115200 CONFIG_EXAMPLE_UART_RXD=3 CONFIG_EXAMPLE_UART_TXD=1 -CONFIG_ENABLE_PW_RPC=y \ No newline at end of file +CONFIG_ENABLE_PW_RPC=y + +# Disable shell +CONFIG_ENABLE_CHIP_SHELL=n \ No newline at end of file diff --git a/examples/all-clusters-app/linux/main.cpp b/examples/all-clusters-app/linux/main.cpp index d2a4cf2a27dd95..4c3048e3225a71 100644 --- a/examples/all-clusters-app/linux/main.cpp +++ b/examples/all-clusters-app/linux/main.cpp @@ -28,18 +28,44 @@ bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj) return true; } -Identify gIdentify0 = { - chip::EndpointId{ 0 }, - [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); }, - [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); }, - EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, +void OnIdentifyStart(Identify *) +{ + ChipLogProgress(Zcl, "OnIdentifyStart"); +} + +void OnIdentifyStop(Identify *) +{ + ChipLogProgress(Zcl, "OnIdentifyStop"); +} + +void OnTriggerEffect(Identify * identify) +{ + switch (identify->mCurrentEffectIdentifier) + { + case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK: + ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK"); + break; + case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE: + ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE"); + break; + case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY: + ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY"); + break; + case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE: + ChipLogProgress(Zcl, "EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_CHANNEL_CHANGE"); + break; + default: + ChipLogProgress(Zcl, "No identifier effect"); + return; + } +} + +static Identify gIdentify0 = { + chip::EndpointId{ 0 }, OnIdentifyStart, OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerEffect, }; -Identify gIdentify1 = { - chip::EndpointId{ 1 }, - [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); }, - [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); }, - EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, +static Identify gIdentify1 = { + chip::EndpointId{ 1 }, OnIdentifyStart, OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerEffect, }; int main(int argc, char * argv[]) diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 36a8c530bd8575..5352f41b9a3f3d 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -4018,6 +4018,5 @@ "endpointVersion": null, "deviceIdentifier": null } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index cda02a820a4569..7f5a419fe7dd25 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -34,6 +34,8 @@ executable("chip-tool") { "commands/discover/DiscoverCommand.cpp", "commands/discover/DiscoverCommissionablesCommand.cpp", "commands/discover/DiscoverCommissionersCommand.cpp", + "commands/pairing/CommissionedListCommand.cpp", + "commands/pairing/CommissionedListCommand.h", "commands/pairing/PairingCommand.cpp", "commands/payload/AdditionalDataParseCommand.cpp", "commands/payload/SetupPayloadParseCommand.cpp", diff --git a/examples/chip-tool/commands/common/Command.cpp b/examples/chip-tool/commands/common/Command.cpp index 9b0b1bdd190e18..e1c9ba153c1d82 100644 --- a/examples/chip-tool/commands/common/Command.cpp +++ b/examples/chip-tool/commands/common/Command.cpp @@ -74,11 +74,11 @@ static bool ParseAddressWithInterface(const char * addressString, Command::Addre if (result->ai_family == AF_INET6) { struct sockaddr_in6 * addr = reinterpret_cast(result->ai_addr); - address->interfaceId = addr->sin6_scope_id; + address->interfaceId = ::chip::Inet::InterfaceId(addr->sin6_scope_id); } else { - address->interfaceId = INET_NULL_INTERFACEID; + address->interfaceId = chip::Inet::InterfaceId::Null(); } return true; diff --git a/examples/chip-tool/commands/common/Command.h b/examples/chip-tool/commands/common/Command.h index fa2de16f40fc7e..e3da77dd679108 100644 --- a/examples/chip-tool/commands/common/Command.h +++ b/examples/chip-tool/commands/common/Command.h @@ -19,8 +19,10 @@ #pragma once #include "controller/ExampleOperationalCredentialsIssuer.h" +#include #include #include +#include #include #include @@ -151,6 +153,34 @@ class Command return AddArgument(name, min, max, reinterpret_cast *>(out)); } + template + size_t AddArgument(const char * name, chip::Optional * value) + { + // We always require our args to be provided for the moment. + return AddArgument(name, &value->Emplace()); + } + + template + size_t AddArgument(const char * name, int64_t min, uint64_t max, chip::Optional * value) + { + // We always require our args to be provided for the moment. + return AddArgument(name, min, max, &value->Emplace()); + } + + template + size_t AddArgument(const char * name, chip::app::DataModel::Nullable * value) + { + // We always require our args to be provided for the moment. + return AddArgument(name, &value->SetNonNull()); + } + + template + size_t AddArgument(const char * name, int64_t min, uint64_t max, chip::app::DataModel::Nullable * value) + { + // We always require our args to be provided for the moment. + return AddArgument(name, min, max, &value->SetNonNull()); + } + virtual CHIP_ERROR Run() = 0; private: diff --git a/examples/chip-tool/commands/pairing/Commands.h b/examples/chip-tool/commands/pairing/Commands.h index 40e11b5380040b..3b7ba676271605 100644 --- a/examples/chip-tool/commands/pairing/Commands.h +++ b/examples/chip-tool/commands/pairing/Commands.h @@ -18,6 +18,7 @@ #pragma once +#include "CommissionedListCommand.h" #include "PairingCommand.h" class Unpair : public PairingCommand @@ -169,6 +170,7 @@ void registerCommandsPairing(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), }; commands.Register(clusterName, clusterCommands); diff --git a/examples/chip-tool/commands/pairing/CommissionedListCommand.cpp b/examples/chip-tool/commands/pairing/CommissionedListCommand.cpp new file mode 100644 index 00000000000000..ed617fc07cf6d9 --- /dev/null +++ b/examples/chip-tool/commands/pairing/CommissionedListCommand.cpp @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2021 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 "CommissionedListCommand.h" + +#include +#include +#include +#include + +CHIP_ERROR CommissionedListCommand::Run() +{ + ReturnLogErrorOnFailure(mStorage.Init()); + return PrintInformation(); +} + +CHIP_ERROR CommissionedListCommand::PrintInformation() +{ + uint64_t pairedNodesIds[chip::Controller::kNumMaxPairedDevices]; + uint16_t pairedNodesIdsSize = sizeof(pairedNodesIds); + memset(pairedNodesIds, 0, pairedNodesIdsSize); + + PERSISTENT_KEY_OP(static_cast(0), chip::kPairedDeviceListKeyPrefix, key, + ReturnLogErrorOnFailure(mStorage.SyncGetKeyValue(key, pairedNodesIds, pairedNodesIdsSize))); + + chip::SerializableU64Set devices; + devices.Deserialize(chip::ByteSpan((uint8_t *) pairedNodesIds, pairedNodesIdsSize)); + + uint16_t pairedDevicesCount = 0; + while (pairedNodesIds[pairedDevicesCount] != 0x0 && pairedDevicesCount < chip::Controller::kNumMaxPairedDevices) + { + pairedDevicesCount++; + } + + if (pairedDevicesCount == 0) + { + ChipLogProgress(chipTool, "No paired devices."); + } + else + { + fprintf(stdout, "NOTES: Only the devices locally commissioned with chip-tool are displayed.\n"); + fprintf(stdout, "+---------------------------------------------------------------------------------------------+\n"); + fprintf(stdout, "| NodeId | Address | Port | Interface |\n"); + fprintf(stdout, "+---------------------------------------------------------------------------------------------+\n"); + for (uint16_t i = 0; i < pairedDevicesCount; i++) + { + ReturnLogErrorOnFailure(PrintDeviceInformation(pairedNodesIds[i])); + } + fprintf(stdout, "+---------------------------------------------------------------------------------------------+\n"); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR CommissionedListCommand::PrintDeviceInformation(chip::NodeId deviceId) +{ + chip::Controller::SerializedDevice deviceInfo; + uint16_t size = sizeof(deviceInfo.inner); + + PERSISTENT_KEY_OP(deviceId, chip::kPairedDeviceKeyPrefix, key, + ReturnLogErrorOnFailure(mStorage.SyncGetKeyValue(key, deviceInfo.inner, size))); + VerifyOrReturnError(size <= sizeof(deviceInfo.inner), CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR); + + chip::Controller::SerializableDevice serializable; + constexpr size_t maxlen = BASE64_ENCODED_LEN(sizeof(serializable)); + const size_t len = strnlen(chip::Uint8::to_const_char(&deviceInfo.inner[0]), maxlen); + + VerifyOrReturnError(len < sizeof(chip::Controller::SerializedDevice), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(chip::CanCastTo(len), CHIP_ERROR_INVALID_ARGUMENT); + + CHIP_ZERO_AT(serializable); + const uint16_t deserializedLen = chip::Base64Decode(chip::Uint8::to_const_char(deviceInfo.inner), static_cast(len), + chip::Uint8::to_uchar(reinterpret_cast(&serializable))); + + VerifyOrReturnError(deserializedLen > 0, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(deserializedLen <= sizeof(serializable), CHIP_ERROR_INVALID_ARGUMENT); + + const uint16_t port = chip::Encoding::LittleEndian::HostSwap16(serializable.mDevicePort); + fprintf(stderr, "| 0x%-16" PRIx64 " | %-45s | %-5u| %-15s |\n", deviceId, serializable.mDeviceAddr, port, + serializable.mInterfaceName); + + return CHIP_NO_ERROR; +} diff --git a/examples/chip-tool/commands/pairing/CommissionedListCommand.h b/examples/chip-tool/commands/pairing/CommissionedListCommand.h new file mode 100644 index 00000000000000..6d04f93b452f4e --- /dev/null +++ b/examples/chip-tool/commands/pairing/CommissionedListCommand.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021 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 "../../config/PersistentStorage.h" +#include "../common/Command.h" + +class CommissionedListCommand : public Command +{ +public: + CommissionedListCommand() : Command("list") {} + CHIP_ERROR Run() override; + +private: + CHIP_ERROR PrintInformation(); + CHIP_ERROR PrintDeviceInformation(chip::NodeId deviceId); + + PersistentStorage mStorage; +}; diff --git a/examples/chip-tool/commands/pairing/PairingCommand.cpp b/examples/chip-tool/commands/pairing/PairingCommand.cpp index bdf473df229982..efd4581ca57211 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.cpp +++ b/examples/chip-tool/commands/pairing/PairingCommand.cpp @@ -155,11 +155,22 @@ CHIP_ERROR PairingCommand::Unpair(NodeId remoteId) return err; } +void PairingCommand::OnOpenCommissioningWindowResponse(void * context, NodeId remoteId, CHIP_ERROR err, chip::SetupPayload payload) +{ + PairingCommand * command = reinterpret_cast(context); + if (err != CHIP_NO_ERROR) + { + ChipLogError(chipTool, + "Failed in opening commissioning window on the device: 0x" ChipLogFormatX64 ", error %" CHIP_ERROR_FORMAT, + ChipLogValueX64(remoteId), err.Format()); + } + command->SetCommandExitStatus(err); +} + CHIP_ERROR PairingCommand::OpenCommissioningWindow() { - CHIP_ERROR err = mController.OpenCommissioningWindow(mNodeId, mTimeout, mIteration, mDiscriminator, mCommissioningWindowOption); - SetCommandExitStatus(err); - return err; + return mController.OpenCommissioningWindowWithCallback(mNodeId, mTimeout, mIteration, mDiscriminator, + mCommissioningWindowOption, &mOnOpenCommissioningWindowCallback); } void PairingCommand::OnStatusUpdate(DevicePairingDelegate::Status status) @@ -428,7 +439,7 @@ void PairingCommand::OnDiscoveredDevice(const chip::Dnssd::DiscoveredNodeData & // Stop Mdns discovery. Is it the right method ? mController.RegisterDeviceDiscoveryDelegate(nullptr); - Inet::InterfaceId interfaceId = nodeData.ipAddress[0].IsIPv6LinkLocal() ? nodeData.interfaceId[0] : INET_NULL_INTERFACEID; + Inet::InterfaceId interfaceId = nodeData.ipAddress[0].IsIPv6LinkLocal() ? nodeData.interfaceId[0] : Inet::InterfaceId::Null(); PeerAddress peerAddress = PeerAddress::UDP(nodeData.ipAddress[0], port, interfaceId); CHIP_ERROR err = Pair(mNodeId, peerAddress); if (CHIP_NO_ERROR != err) diff --git a/examples/chip-tool/commands/pairing/PairingCommand.h b/examples/chip-tool/commands/pairing/PairingCommand.h index e3fbd05d6e6abf..c3c23cfffffefa 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.h +++ b/examples/chip-tool/commands/pairing/PairingCommand.h @@ -58,8 +58,10 @@ class PairingCommand : public CHIPCommand, chip::Dnssd::DiscoveryFilterType filterType = chip::Dnssd::DiscoveryFilterType::kNone) : CHIPCommand(commandName), mPairingMode(mode), mNetworkType(networkType), - mFilterType(filterType), mRemoteAddr{ IPAddress::Any, INET_NULL_INTERFACEID }, - mOnDeviceConnectedCallback(OnDeviceConnectedFn, this), mOnDeviceConnectionFailureCallback(OnDeviceConnectionFailureFn, this) + mFilterType(filterType), mRemoteAddr{ IPAddress::Any, chip::Inet::InterfaceId::Null() }, + mOnDeviceConnectedCallback(OnDeviceConnectedFn, this), + mOnDeviceConnectionFailureCallback(OnDeviceConnectionFailureFn, this), + mOnOpenCommissioningWindowCallback(OnOpenCommissioningWindowResponse, this) { AddArgument("node-id", 0, UINT64_MAX, &mNodeId); @@ -214,7 +216,9 @@ class PairingCommand : public CHIPCommand, static void OnDeviceConnectedFn(void * context, chip::Controller::Device * device); static void OnDeviceConnectionFailureFn(void * context, NodeId deviceId, CHIP_ERROR error); + static void OnOpenCommissioningWindowResponse(void * context, NodeId deviceId, CHIP_ERROR status, chip::SetupPayload payload); chip::Callback::Callback mOnDeviceConnectedCallback; chip::Callback::Callback mOnDeviceConnectionFailureCallback; + chip::Callback::Callback mOnOpenCommissioningWindowCallback; }; diff --git a/examples/chip-tool/commands/tests/TestCommand.h b/examples/chip-tool/commands/tests/TestCommand.h index ebc5194a9001a1..998f86bf965550 100644 --- a/examples/chip-tool/commands/tests/TestCommand.h +++ b/examples/chip-tool/commands/tests/TestCommand.h @@ -194,6 +194,18 @@ class TestCommand : public CHIPCommand bool CheckValueAsString(const char * itemName, chip::CharSpan current, const char * expected); + template + bool CheckValuePresent(const char * itemName, const chip::Optional & value) + { + if (value.HasValue()) + { + return true; + } + + Exit(std::string(itemName) + " expected to have value but doesn't"); + return false; + } + chip::Callback::Callback mOnDeviceConnectedCallback; chip::Callback::Callback mOnDeviceConnectionFailureCallback; diff --git a/examples/chip-tool/templates/commands.zapt b/examples/chip-tool/templates/commands.zapt index 65d66564f6ec0a..e1e814eb5b5590 100644 --- a/examples/chip-tool/templates/commands.zapt +++ b/examples/chip-tool/templates/commands.zapt @@ -192,6 +192,8 @@ static void On{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}Success(v {{~#*inline "field"}}data.{{asLowerCamelCase label}}{{/inline~}} {{#if isArray}} ChipLogProgress(Zcl, " {{label}}: Array printing is not implemented yet."); + {{else if isOptional}} + ChipLogProgress(Zcl, " {{label}}: Optional printing is not implemented yet."); {{else if (isOctetString type)}} ChipLogProgress(Zcl, " {{label}}: %zu", {{>field}}.size()); {{else if (isCharString type)}} diff --git a/examples/chip-tool/templates/partials/test_cluster.zapt b/examples/chip-tool/templates/partials/test_cluster.zapt index 80f0ed1a2084cf..3ff426f2a28923 100644 --- a/examples/chip-tool/templates/partials/test_cluster.zapt +++ b/examples/chip-tool/templates/partials/test_cluster.zapt @@ -171,8 +171,12 @@ class {{filename}}: public TestCommand VerifyOrReturn(mReceivedReport_{{waitForReport.index}}, Exit("Initial report not received!")); {{/if}} {{#chip_tests_item_response_parameters}} - {{~#*inline "item"}}{{asLowerCamelCase name}}{{/inline}} + {{~#*inline "item"}}{{asLowerCamelCase name}}{{#if isOptional}}.Value(){{/if}}{{/inline}} {{#if hasExpectedValue}} + {{#if isOptional}} + {{~#*inline "item"}}{{asLowerCamelCase name}}{{/inline}} + VerifyOrReturn(CheckValuePresent("{{> item}}", {{> item}})); + {{/if}} VerifyOrReturn(CheckValue {{~#if isList}}AsListLength("{{>item}}", {{>item}}, {{expectedValue.length}}) {{else if isArray}}AsList("{{>item}}", {{>item}}, {{expectedValue}}) @@ -182,6 +186,10 @@ class {{filename}}: public TestCommand ); {{/if}} {{#if hasExpectedConstraints}} + {{#if isOptional}} + {{~#*inline "item"}}{{asLowerCamelCase name}}{{/inline}} + VerifyOrReturn(CheckValuePresent("{{> item}}", {{> item}})); + {{/if}} {{#if expectedConstraints.type}}VerifyOrReturn(CheckConstraintType("{{>item}}", "", "{{expectedConstraints.type}}"));{{/if}} {{~#if expectedConstraints.format}}VerifyOrReturn(CheckConstraintFormat("{{>item}}", "", "{{expectedConstraints.format}}"));{{/if}} {{~#if expectedConstraints.minLength}}VerifyOrReturn(CheckConstraintMinLength("{{>item}}", {{>item}}.size(), {{expectedConstraints.minLength}}));{{/if}} diff --git a/examples/chip-tool/templates/partials/test_cluster_command_value.zapt b/examples/chip-tool/templates/partials/test_cluster_command_value.zapt index f9808323bf1cbf..de99a1553ae79d 100644 --- a/examples/chip-tool/templates/partials/test_cluster_command_value.zapt +++ b/examples/chip-tool/templates/partials/test_cluster_command_value.zapt @@ -1,7 +1,21 @@ -{{#if isArray}} +{{#if isOptional}} + {{#if ignore}} + {{>commandValue ns=ns container=(concat container ".Emplace()") definedValue=definedValue type=type isOptional=false ignore=true}} + {{else}} + {{>commandValue ns=ns container=(concat container "." label ".Emplace()") definedValue=definedValue type=type isOptional=false ignore=true}} + {{/if}} +{{else if isNullable}} + {{#if ignore}} + {{>commandValue ns=ns container=(concat container ".SetNonNull()") definedValue=definedValue type=type isNullable=false ignore=true}} + {{else}} + {{>commandValue ns=ns container=(concat container "." label ".SetNonNull()") definedValue=definedValue type=type isNullable=false ignore=true}} + {{/if}} +{{else if isArray}} - {{! forceNotList=true because we really want the type of a single item here }} - {{zapTypeToEncodableClusterObjectType type ns=ns forceNotList=true}} {{asLowerCamelCase label}}List[{{definedValue.length}}]; + {{! forceNotList=true because we really want the type of a single item here. + Similarly, forceNotOptional=true and forceNotNullable=true because we + have accounted for those already. }} + {{zapTypeToEncodableClusterObjectType type ns=ns forceNotList=true forceNotNullable=true forceNotOptional=true}} {{asLowerCamelCase label}}List[{{definedValue.length}}]; {{#each definedValue}} {{>commandValue ns=../ns container=(concat (asLowerCamelCase ../label) "List[" @index "]") definedValue=. type=../type ignore=true}} {{/each}} diff --git a/examples/chip-tool/templates/tests.js b/examples/chip-tool/templates/tests.js index dc8a2dd28a8f49..12fe1d08ffa5ef 100644 --- a/examples/chip-tool/templates/tests.js +++ b/examples/chip-tool/templates/tests.js @@ -57,6 +57,7 @@ function getTests() const OccupancySensing = [ 'Test_TC_OCC_1_1', + 'Test_TC_OCC_2_1', ]; const LevelControl = [ @@ -67,6 +68,12 @@ function getTests() const MediaControl = [ 'Test_TC_MC_1_1', + 'Test_TC_MC_3_6', + 'Test_TC_MC_3_7', + 'Test_TC_MC_3_8', + 'Test_TC_MC_3_9', + 'Test_TC_MC_3_10', + 'Test_TC_MC_3_11', ]; const OnOff = [ @@ -78,10 +85,13 @@ function getTests() const PumpConfigurationControl = [ 'Test_TC_PCC_1_1', 'Test_TC_PCC_2_1', + 'Test_TC_PCC_2_2', + 'Test_TC_PCC_2_3', ]; const RelativeHumidityMeasurement = [ 'Test_TC_RH_1_1', + 'Test_TC_RH_2_1', ]; const TemperatureMeasurement = [ @@ -132,6 +142,7 @@ function getTests() 'TestLogCommands', 'TestDescriptorCluster', 'TestBasicInformation', + 'TestIdentifyCluster', 'TestOperationalCredentialsCluster', ]; diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index 21332bc8e7d973..a9173352ebb160 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -6211,6 +6211,5 @@ "endpointVersion": 1, "deviceIdentifier": 259 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index f0c40b827fe500..34c1d9d3c12b43 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -5022,6 +5022,5 @@ "endpointVersion": 0, "deviceIdentifier": null } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lock-app/nrfconnect/Kconfig b/examples/lock-app/nrfconnect/Kconfig new file mode 100644 index 00000000000000..2b702dc9fc0ebe --- /dev/null +++ b/examples/lock-app/nrfconnect/Kconfig @@ -0,0 +1,26 @@ +# +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +mainmenu "Matter nRF Connect Lock Example Application" + +config STATE_LEDS + bool "Use LEDs to indicate the device state" + default y + help + Use LEDs to render the current state of the device such as the progress of commissioning of + the device into a network or the factory reset initiation. Note that setting this option to + 'n' does not disable the LED indicating the state of the simulated bolt. + +source "Kconfig.zephyr" diff --git a/examples/lock-app/nrfconnect/README.md b/examples/lock-app/nrfconnect/README.md index 5e783e75c16f61..9ba97aec6f326e 100644 --- a/examples/lock-app/nrfconnect/README.md +++ b/examples/lock-app/nrfconnect/README.md @@ -33,6 +33,7 @@ into an existing Matter network and can be controlled by this network. - [Building](#building) - [Removing build artifacts](#removing-build-artifacts) - [Building with release configuration](#building-with-release-configuration) + - [Building with low-power configuration](#building-with-low-power-configuration) - [Building with Device Firmware Upgrade support](#building-with-device-firmware-upgrade-support) - [Configuring the example](#configuring-the-example) - [Flashing and debugging](#flashing-and-debugging) @@ -361,6 +362,22 @@ features like logs and command-line interface, run the following command: Remember to replace _build-target_ with the build target name of the Nordic Semiconductor's kit you own. +### Building with low-power configuration + +You can build the example using the low-power configuration, which enables +Thread's Sleepy End Device mode and disables debug features, such as the UART +console or the **LED 1** usage. + +To build for the low-power configuration, run the following command with +_build-target_ replaced with the build target name of the Nordic Semiconductor's +kit you own (for example `nrf52840dk_nrf52840`): + + $ west build -b build-target -- -DOVERLAY_CONFIG=overlay-low_power.conf + +For example, use the following command for `nrf52840dk_nrf52840`: + + $ west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG=overlay-low_power.conf + ### Building with Device Firmware Upgrade support To build the example with configuration that enables DFU, run the following diff --git a/examples/lock-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay b/examples/lock-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay index e3716a4a9248e9..7885945015b516 100644 --- a/examples/lock-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay +++ b/examples/lock-app/nrfconnect/boards/nrf52840dk_nrf52840.overlay @@ -25,3 +25,29 @@ zephyr,entropy = &rng; }; }; + +/* Disable unused peripherals to reduce power consumption */ +&adc { + status = "disabled"; +}; +&uart1 { + status = "disabled"; +}; +&gpio1 { + status = "disabled"; +}; +&i2c0 { + status = "disabled"; +}; +&pwm0 { + status = "disabled"; +}; +&spi1 { + status = "disabled"; +}; +&spi3 { + status = "disabled"; +}; +&usbd { + status = "disabled"; +}; diff --git a/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay index e7e363e23d5998..6984cad3ead2db 100644 --- a/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -60,3 +60,23 @@ }; }; + +/* Disable unused peripherals to reduce power consumption */ +&adc { + status = "disabled"; +}; +&gpio1 { + status = "disabled"; +}; +&i2c1 { + status = "disabled"; +}; +&pwm0 { + status = "disabled"; +}; +&spi2 { + status = "disabled"; +}; +&usbd { + status = "disabled"; +}; diff --git a/examples/lock-app/nrfconnect/main/AppTask.cpp b/examples/lock-app/nrfconnect/main/AppTask.cpp index 6ae8735efb8073..670b27f0665c12 100644 --- a/examples/lock-app/nrfconnect/main/AppTask.cpp +++ b/examples/lock-app/nrfconnect/main/AppTask.cpp @@ -212,6 +212,7 @@ void AppTask::FunctionTimerEventHandler(AppEvent * aEvent) sAppTask.StartTimer(FACTORY_RESET_CANCEL_WINDOW_TIMEOUT); sAppTask.mFunction = kFunction_FactoryReset; +#ifdef CONFIG_STATE_LEDS // Turn off all LEDs before starting blink to make sure blink is co-ordinated. sStatusLED.Set(false); sLockLED.Set(false); @@ -222,6 +223,7 @@ void AppTask::FunctionTimerEventHandler(AppEvent * aEvent) sLockLED.Blink(500); sUnusedLED.Blink(500); sUnusedLED_1.Blink(500); +#endif } else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_FactoryReset) { @@ -357,6 +359,7 @@ void AppTask::LEDStateUpdateHandler(LEDWidget & ledWidget) void AppTask::UpdateStatusLED() { +#ifdef CONFIG_STATE_LEDS /* Update the status LED. * * If thread and service provisioned, keep the LED On constantly. @@ -377,6 +380,7 @@ void AppTask::UpdateStatusLED() { sStatusLED.Blink(50, 950); } +#endif } void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t /* arg */) diff --git a/examples/lock-app/nrfconnect/main/main.cpp b/examples/lock-app/nrfconnect/main/main.cpp index b6c344116e4646..e69bfcf214c0ff 100644 --- a/examples/lock-app/nrfconnect/main/main.cpp +++ b/examples/lock-app/nrfconnect/main/main.cpp @@ -66,12 +66,33 @@ int main() goto exit; } +#ifdef CONFIG_OPENTHREAD_MTD_SED + err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice); + if (err != CHIP_NO_ERROR) + { + LOG_ERR("ConnectivityMgr().SetThreadDeviceType() failed"); + goto exit; + } + + ConnectivityManager::ThreadPollingConfig pollingConfig; + pollingConfig.Clear(); + pollingConfig.ActivePollingIntervalMS = CONFIG_OPENTHREAD_POLL_PERIOD; + pollingConfig.InactivePollingIntervalMS = CONFIG_OPENTHREAD_POLL_PERIOD; + + err = ConnectivityMgr().SetThreadPollingConfig(pollingConfig); + if (err != CHIP_NO_ERROR) + { + LOG_ERR("ConnectivityMgr().SetThreadPollingConfig() failed"); + goto exit; + } +#else err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); if (err != CHIP_NO_ERROR) { LOG_ERR("ConnectivityMgr().SetThreadDeviceType() failed"); goto exit; } +#endif ret = GetAppTask().StartApp(); if (ret != 0) diff --git a/examples/lock-app/nrfconnect/overlay-low_power.conf b/examples/lock-app/nrfconnect/overlay-low_power.conf new file mode 100644 index 00000000000000..55c65860f3861b --- /dev/null +++ b/examples/lock-app/nrfconnect/overlay-low_power.conf @@ -0,0 +1,31 @@ +# +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Enable MTD Sleepy End Device +CONFIG_OPENTHREAD_MTD_SED=y +CONFIG_OPENTHREAD_POLL_PERIOD=2000 + +# Disable UART console +CONFIG_SHELL=n +CONFIG_LOG=n +CONFIG_UART_CONSOLE=n +CONFIG_SERIAL=n + +# Suspend devices when the CPU goes to sleep +CONFIG_PM_DEVICE=y + +# Disable auxiliary state LEDs +CONFIG_STATE_LEDS=n diff --git a/examples/minimal-mdns/AllInterfaceListener.h b/examples/minimal-mdns/AllInterfaceListener.h index 7a1b31420f6fb3..178c91b189e8e4 100644 --- a/examples/minimal-mdns/AllInterfaceListener.h +++ b/examples/minimal-mdns/AllInterfaceListener.h @@ -39,7 +39,7 @@ class AllInterfaces : public mdns::Minimal::ListenIterator if (mState == State::kIpV4) { #if INET_CONFIG_ENABLE_IPV4 - *id = INET_NULL_INTERFACEID; + *id = Inet::InterfaceId::Null(); *type = chip::Inet::IPAddressType::kIPv4; #endif mState = State::kIpV6; @@ -100,7 +100,7 @@ class AllInterfaces : public mdns::Minimal::ListenIterator return true; // not a usable interface } - char name[chip::Inet::InterfaceIterator::kMaxIfNameLength]; + char name[chip::Inet::InterfaceId::kMaxIfNameLength]; if (mIterator.GetInterfaceName(name, sizeof(name)) != CHIP_NO_ERROR) { printf("!!!! FAILED TO GET INTERFACE NAME\n"); diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap index dde97b12852916..6c5a28111dddad 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 54, + "featureLevel": 63, "creator": "zap", "keyValuePairs": [ { @@ -3410,7 +3410,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -3425,7 +3425,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -3440,7 +3440,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -3638,4 +3638,4 @@ "deviceIdentifier": null } ] -} +} \ No newline at end of file diff --git a/examples/ota-requestor-app/linux/main.cpp b/examples/ota-requestor-app/linux/main.cpp index f0c0e3902b7767..bcec4be7d50356 100644 --- a/examples/ota-requestor-app/linux/main.cpp +++ b/examples/ota-requestor-app/linux/main.cpp @@ -244,7 +244,7 @@ bool HandleOptions(const char * aProgram, OptionSet * aOptions, int aIdentifier, return (retval); } -void SendQueryImageCommand() +void SendQueryImageCommand(chip::NodeId peerNodeId = providerNodeId, chip::FabricIndex peerFabricIndex = providerFabricIndex) { // Explicitly calling UpdateAddress() should not be needed once OperationalDeviceProxy can resolve IP address from node ID and // fabric index @@ -261,9 +261,8 @@ void SendQueryImageCommand() .fabricsTable = &(server->GetFabricTable()), }; - CHIP_ERROR err = CHIP_NO_ERROR; - FabricIndex peerFabricIndex = providerFabricIndex; - gOperationalDeviceProxy.Init(providerNodeId, peerFabricIndex, initParams); + CHIP_ERROR err = CHIP_NO_ERROR; + gOperationalDeviceProxy.Init(peerNodeId, peerFabricIndex, initParams); err = gOperationalDeviceProxy.Connect(&mOnConnectedCallback, &mOnConnectionFailureCallback); if (err != CHIP_NO_ERROR) { @@ -316,6 +315,9 @@ int main(int argc, char * argv[]) // Initialize device attestation config SetDeviceAttestationCredentialsProvider(chip::Credentials::Examples::GetExampleDACProvider()); + // This will allow ExampleOTARequestor to call SendQueryImageCommand + ExampleOTARequestor::GetInstance().SetConnectToProviderCallback(SendQueryImageCommand); + // If a delay is provided, QueryImage after the timer expires if (delayQueryTimeInSec > 0) { diff --git a/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.cpp b/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.cpp index f677afb692482b..6805e2047911e0 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.cpp +++ b/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.cpp @@ -61,18 +61,18 @@ void ExampleOTARequestor::Init(chip::Controller::ControllerDeviceInitParams conn void ExampleOTARequestor::ConnectToProvider() { - FabricInfo * providerFabric = GetProviderFabricInfo(); - VerifyOrReturn(providerFabric != nullptr, - ChipLogError(SoftwareUpdate, "No Fabric found for index %" PRIu8, mProviderFabricIndex)); - - ChipLogProgress(SoftwareUpdate, - "Once #7976 is fixed, this would attempt to connect to 0x" ChipLogFormatX64 " on FabricIndex 0x%" PRIu8 - " (" ChipLogFormatX64 ")", - ChipLogValueX64(mProviderNodeId), mProviderFabricIndex, ChipLogValueX64(providerFabric->GetFabricId())); - - // TODO: uncomment and fill in after #7976 is fixed - // mProviderDevice.Init(mConnectParams, mProviderNodeId, address, mProviderFabricIndex); - // mProviderDevice.EstablishConnectivity(); + + if (mConnectToProviderCallback != nullptr) + { + ChipLogProgress(SoftwareUpdate, "Attempting to connect to 0x" ChipLogFormatX64 " on FabricIndex 0x%" PRIu8, + ChipLogValueX64(mProviderNodeId), mProviderFabricIndex); + + mConnectToProviderCallback(mProviderNodeId, mProviderFabricIndex); + } + else + { + ChipLogError(SoftwareUpdate, "ConnectToProviderCallback is not set"); + } } EmberAfStatus ExampleOTARequestor::HandleAnnounceOTAProvider( @@ -91,16 +91,8 @@ EmberAfStatus ExampleOTARequestor::HandleAnnounceOTAProvider( mProviderNodeId = providerLocation; mProviderFabricIndex = commandObj->GetExchangeContext()->GetSessionHandle().GetFabricIndex(); - FabricInfo * providerFabric = GetProviderFabricInfo(); - if (providerFabric == nullptr) - { - ChipLogError(SoftwareUpdate, "No Fabric found for index %" PRIu8, mProviderFabricIndex); - return EMBER_ZCL_STATUS_SUCCESS; - } - - ChipLogProgress(SoftwareUpdate, - "Notified of Provider at NodeID: 0x" ChipLogFormatX64 "on FabricIndex 0x%" PRIu8 " (" ChipLogFormatX64 ")", - ChipLogValueX64(mProviderNodeId), mProviderFabricIndex, ChipLogValueX64(providerFabric->GetFabricId())); + ChipLogProgress(SoftwareUpdate, "Notified of Provider at NodeID: 0x" ChipLogFormatX64 " on FabricIndex 0x%" PRIu8, + ChipLogValueX64(mProviderNodeId), mProviderFabricIndex); // If reason is URGENT_UPDATE_AVAILABLE, we start OTA immediately. Otherwise, respect the timer value set in mOtaStartDelayMs. // This is done to exemplify what a real-world OTA Requestor might do while also being configurable enough to use as a test app. diff --git a/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.h b/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.h index 5cec185c847908..4cdcc2eea2297a 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.h +++ b/examples/ota-requestor-app/ota-requestor-common/ExampleOTARequestor.h @@ -39,6 +39,9 @@ class ExampleOTARequestor chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OtaSoftwareUpdateRequestor::Commands::AnnounceOtaProvider::DecodableType & commandData); + // Setter for mConnectToProviderCallback + void SetConnectToProviderCallback(void (*f)(chip::NodeId, chip::FabricIndex)) { mConnectToProviderCallback = f; } + private: ExampleOTARequestor(); @@ -53,4 +56,9 @@ class ExampleOTARequestor chip::NodeId mProviderNodeId; chip::FabricIndex mProviderFabricIndex; uint32_t mOtaStartDelayMs; + + // TODO: This will be redone once the full Requestor app design is in place + // Pointer to the function that establishes a session with the Provider and initiates + // the BDX download + void (*mConnectToProviderCallback)(chip::NodeId, chip::FabricIndex); }; diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap index 74b57608deef62..c517ddfcacc918 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 62, + "featureLevel": 63, "creator": "zap", "keyValuePairs": [ { @@ -3434,7 +3434,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -3449,7 +3449,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -3464,7 +3464,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -3661,6 +3661,5 @@ "endpointVersion": 1, "deviceIdentifier": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/placeholder/linux/BUILD.gn b/examples/placeholder/linux/BUILD.gn index 8e364faadd81e5..b4a9fded006376 100644 --- a/examples/placeholder/linux/BUILD.gn +++ b/examples/placeholder/linux/BUILD.gn @@ -22,7 +22,7 @@ declare_args() { } chip_data_model("configuration") { - zap_file = "apps/${chip_tests_zap_config}/zap.config" + zap_file = "apps/${chip_tests_zap_config}/config.zap" zap_pregenerated_dir = "${chip_root}/out/debug/placeholder/${chip_tests_zap_config}/zap-generated" is_server = true diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap new file mode 100644 index 00000000000000..8b52f71706c7d0 --- /dev/null +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -0,0 +1,1911 @@ +{ + "featureLevel": 63, + "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", + "version": "ZCL Test Data", + "type": "zcl-properties" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../../../src/app/zap-templates/app-templates.json", + "version": "chip-v1", + "type": "gen-templates-json" + } + ], + "endpointTypes": [ + { + "name": "Anonymous Endpoint Type", + "deviceTypeName": "Base Application Example", + "deviceTypeCode": 65280, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "device list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "server list", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "client list", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "parts list", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic", + "code": 40, + "mfgCode": null, + "define": "BASIC_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic", + "code": 40, + "mfgCode": null, + "define": "BASIC_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "InteractionModelVersion", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UserLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfoList", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "OpCSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveTrustedRootCertificate", + "code": 12, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "OpCSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "fabrics list", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "name": "Anonymous Endpoint Type", + "deviceTypeName": "LO-colordimmablelight", + "deviceTypeCode": 258, + "deviceTypeProfileId": 260, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "IdentifyQuery", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "IdentifyQueryResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "identify time", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "identify type", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "name support", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "scene count", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "current scene", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "current group", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "scene valid", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "name support", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "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", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "current level", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic", + "code": 40, + "mfgCode": null, + "define": "BASIC_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic", + "code": 40, + "mfgCode": null, + "define": "BASIC_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "InteractionModelVersion", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UserLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToColor", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveColor", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepColor", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "current hue", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "current saturation", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "current x", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x616B", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "current y", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x607D", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "color temperature", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00FA", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "color control options", + "code": 15, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "couple color temp to level min-mireds", + "code": 16397, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "start up color temperature mireds", + "code": 16400, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0, + "endpointVersion": 1, + "deviceIdentifier": 65280 + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 1, + "profileId": 260, + "endpointId": 1, + "networkId": 0, + "endpointVersion": 1, + "deviceIdentifier": 258 + } + ] +} \ No newline at end of file diff --git a/examples/placeholder/linux/apps/app1/include/CHIPProjectConfig.h b/examples/placeholder/linux/apps/app1/include/CHIPProjectConfig.h index e497dd10afc496..39c726c4005419 100644 --- a/examples/placeholder/linux/apps/app1/include/CHIPProjectConfig.h +++ b/examples/placeholder/linux/apps/app1/include/CHIPProjectConfig.h @@ -30,3 +30,4 @@ // Use a default pairing code if one hasn't been provisioned in flash. #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF02 +#define CHIP_PORT 5542 diff --git a/examples/placeholder/linux/apps/app1/zap.config b/examples/placeholder/linux/apps/app2/config.zap similarity index 66% rename from examples/placeholder/linux/apps/app1/zap.config rename to examples/placeholder/linux/apps/app2/config.zap index 637afc226e86cb..629dd9fc6d745a 100644 --- a/examples/placeholder/linux/apps/app1/zap.config +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -1,5 +1,5 @@ { - "featureLevel": 55, + "featureLevel": 63, "creator": "zap", "keyValuePairs": [ { @@ -18,13 +18,13 @@ "package": [ { "pathRelativity": "relativeToZap", - "path": "../../../../src/app/zap-templates/zcl/zcl.json", + "path": "../../../../../src/app/zap-templates/zcl/zcl.json", "version": "ZCL Test Data", "type": "zcl-properties" }, { "pathRelativity": "relativeToZap", - "path": "../../../../src/app/zap-templates/app-templates.json", + "path": "../../../../../src/app/zap-templates/app-templates.json", "version": "chip-v1", "type": "gen-templates-json" } @@ -32,8 +32,704 @@ "endpointTypes": [ { "name": "Anonymous Endpoint Type", - "deviceTypeName": "HA-colordimmablelight", - "deviceTypeCode": 258, + "deviceTypeName": "Base Application Example", + "deviceTypeCode": 65280, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "device list", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "server list", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "client list", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "parts list", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic", + "code": 40, + "mfgCode": null, + "define": "BASIC_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic", + "code": 40, + "mfgCode": null, + "define": "BASIC_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "InteractionModelVersion", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UserLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfoList", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "OpCSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveTrustedRootCertificate", + "code": 12, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "OpCSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "fabrics list", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "name": "Anonymous Endpoint Type", + "deviceTypeName": "LO-dimmablelight", + "deviceTypeCode": 257, "deviceTypeProfileId": 260, "clusters": [ { @@ -991,203 +1687,6 @@ "reportableChange": 0 } ] - }, - { - "name": "Color Control", - "code": 768, - "mfgCode": null, - "define": "COLOR_CONTROL_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "MoveToColor", - "code": 7, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "MoveColor", - "code": 8, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - }, - { - "name": "StepColor", - "code": 9, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Color Control", - "code": 768, - "mfgCode": null, - "define": "COLOR_CONTROL_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "current hue", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "current saturation", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "current x", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x616B", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "current y", - "code": 4, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x607D", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "color temperature", - "code": 7, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00FA", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "color control options", - "code": 15, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "couple color temp to level min-mireds", - "code": 16397, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "start up color temperature mireds", - "code": 16400, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] } ] } @@ -1196,12 +1695,20 @@ { "endpointTypeName": "Anonymous Endpoint Type", "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0, + "endpointVersion": 1, + "deviceIdentifier": 65280 + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 1, "profileId": 260, "endpointId": 1, "networkId": 0, "endpointVersion": 1, - "deviceIdentifier": 258 + "deviceIdentifier": 257 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-app/cc13x2x7_26x2x7/README.md b/examples/pump-app/cc13x2x7_26x2x7/README.md index 5b15bef626e2a8..b8e270f63d9e4d 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/README.md +++ b/examples/pump-app/cc13x2x7_26x2x7/README.md @@ -1,11 +1,11 @@ -# CHIP CC1352 CC2652 Lock Example Application +# Matter CC1352 CC2652 Pump Example Application -An example application showing the use [CHIP][chip] on the Texas Instruments -CC13X2_26X2 family of Wireless MCUs. +An example application showing the use of [Matter][matter] on the Texas +Instruments CC13X2_26X2 family of Wireless MCUs. --- -- [CHIP CC1352 CC2652 Lock Example Application](#chip-cc1352-cc2652-lock-example-application) +- [Matter CC1352 CC2652 Pump Example Application](#matter-cc1352-cc2652-pump-example-application) - [Introduction](#introduction) - [Device UI](#device-ui) - [Building](#building) @@ -19,7 +19,7 @@ CC13X2_26X2 family of Wireless MCUs. - [Provisioning](#provisioning) - [Bluetooth LE Advertising](#bluetooth-le-advertising) - [Bluetooth LE Rendezvous](#bluetooth-le-rendezvous) - - [CHIP Remote Commands](#chip-remote-commands) + - [Matter Remote Commands](#matter-remote-commands) - [TI Support](#ti-support) --- @@ -28,34 +28,35 @@ CC13X2_26X2 family of Wireless MCUs. ![CC1352R1_LAUNCHXL](doc/images/cc1352r1_launchxl.jpg) -The CC13X2_26X2 lock example application provides a working demonstration of a -connected door lock device. This uses the open-source CHIP implementation and -the Texas Instruments SimpleLinkâ„¢ CC13x2 and CC26x2 software development kit. +The CC13X2_26X2 pump example application provides a working demonstration of a +connected pump device. This uses the open-source Matter implementation and the +Texas Instruments SimpleLinkâ„¢ CC13x2 and CC26x2 software development kit. This example is enabled to build for CC2652R7 devices. This upcoming devices are currently not yet in full production. For more information on device -availability or early access to an engineering build of our CHIP-enabled SDK, -please reach out [here][ti_cc13x2_26x2_r7_chip_request]. +availability or early access to an engineering build of our Matter-enabled SDK, +please reach out [here][ti_cc13x2_26x2_r7_matter_request]. -The lock example is intended to serve both as a means to explore the workings of -CHIP, as well as a template for creating real products based on the Texas +The pump 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 Texas Instruments devices. ## Device UI This example application has a simple User Interface to depict the state of the -door lock and to control the state. The user LEDs on the LaunchPad are set on -when the lock is locked, and are set off when unlocked. The LEDs will flash when -in the transition state between locked and unlocked. +pump and to control the state. The user LEDs on the LaunchPad are set on when +the pump is started, and are set off when stopped. The LEDs will flash when in +the transition state between started and stopped. -Short presses (less than 1000ms) of the user buttons are used for requesting -lock and unlock of the door lock. The left button (`BTN-1`) is used to request -locking. The right button (`BTN-2`) is used to request unlocking. +Short presses (less than 1000ms) of the left user button (`BTN-1`) are used for +toggling the pump state. -Long presses (greater than 1000ms) of the user buttons are used for controlling -BLE advertisements. The left button (`BTN-1`) is used to disable advertisements -if they are enabled. The Right button (`BTN-2`) is used to enable -advertisements. +Short presses (less than 1000ms) of the right user button (`BTN-2`) are used for +toggling Matter BLE advertisements. + +Long presses (greater than 5000ms) of the right user button (`BTN-2`) will +initiate a factory reset of the device clearing all stored provisioning +information to allow for a new network setup. ## Building @@ -65,7 +66,7 @@ Some initial setup is necessary for preparing the build environment. This section will need to be done when migrating to new versions of the SDK. - An engineering SDK from TI is required. Please request access for it - [here][ti_cc13x2_26x2_r7_chip_request]. + [here][ti_cc13x2_26x2_r7_matter_request]. - Follow the default installation instructions when executing the installer. @@ -124,7 +125,7 @@ Ninja to build the executable. `C:\ti` ``` - $ cd ~/connectedhomeip/examples/lock-app/cc13x2_26x2 + $ cd ~/connectedhomeip/examples/pump-app/cc13x2_26x2 $ export TI_SIMPLELINK_SDK_ROOT= $ export TI_SYSCONFIG_ROOT= $ gn gen out/debug --args="ti_simplelink_sdk_root=\"${TI_SIMPLELINK_SDK_ROOT}\" ti_sysconfig_root=\"${TI_SYSCONFIG_ROOT}\"" @@ -168,27 +169,27 @@ Router][ot_border_router_setup]. ### Provisioning -The first step to bring the CHIP device onto the network is to provision it. Our -example accomplishes this with Bluetooth Low Energy (BLE) and the +The first step to bring the Matter device onto the network is to provision it. +Our example accomplishes this with Bluetooth Low Energy (BLE) and the [CHIPTool](../../../src/android/CHIPTool/README.md) mobile app. #### Bluetooth LE Advertising To provision this example onto a Thread network, the device must be discoverable -over Bluetooth LE. BLE advertising is started by long pressing the right button -(greater than 1000ms), labeled `BTN-2` on the silkscreen. Once the device is -fully provisioned, BLE advertising will stop. +over Bluetooth LE. BLE advertising is started by pressing the right button (less +than 1000ms), labeled `BTN-2` on the silkscreen. Once the device is fully +provisioned, BLE advertising will stop. #### Bluetooth LE Rendezvous In this example, the provisioning procedure (called Rendezvous) is done over -Bluetooth LE between a CHIP device (lock-app) and the CHIP controller +Bluetooth LE between a Matter device (pump-app) and the Matter controller (CHIPTool), where the controller has the commissioner role. To start the rendezvous, the controller must get the commissioning information -from the CHIP device. +from the Matter device. -This is done by scanning a QR code. A URL will be displayed on the lock-app's +This is done by scanning a QR code. A URL will be displayed on the pump-app's log ([UART terminal](#viewing-logging-output)). It will look like the following: ``` @@ -202,21 +203,21 @@ pre-loaded). Alternatively, you can navigate to [the QR code generator][qr_code_generator] and enter in the payload shown in `SetupQRCode` (in this case `MT:.81TM -00 0C9SS0`). -### CHIP Remote Commands +### Matter Remote Commands -Once the CHIP device is provisioned and operating on the network, CHIPTool can -be used to control the device. During the provisioning process, the CHIP device -would have sent one of its newly assigned IPv6 addresses to the CHIPTool. +Once the Matter device is provisioned and operating on the network, CHIPTool can +be used to control the device. During the provisioning process, the Matter +device would have sent one of its newly assigned IPv6 addresses to the CHIPTool. -In the app, you should see an On/Off cluster; this corresponds to the lock-app. -You can now control the lock-app CHIP device from the smartphone! +In the app, you should see an On/Off cluster; this corresponds to the pump-app. +You can now control the pump-app Matter device from the smartphone! ## TI Support For technical support, please consider creating a post on TI's [E2E forum][e2e]. Additionally, we welcome any feedback. -[chip]: https://github.com/project-chip/connectedhomeip +[matter]: https://github.com/project-chip/connectedhomeip [cc1352r1_launchxl]: https://www.ti.com/tool/LAUNCHXL-CC1352R1 [e2e]: https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread [simplelink_sdk]: https://www.ti.com/tool/SIMPLELINK-CC13X2-26X2-SDK @@ -227,7 +228,7 @@ Additionally, we welcome any feedback. http://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.5.0_1397-setup.run [ti_thread_dnd]: https://www.ti.com/wireless-connectivity/thread/design-development.html -[ti_cc13x2_26x2_r7_chip_request]: https://ti.com/chip_sdk +[ti_cc13x2_26x2_r7_matter_request]: https://ti.com/chip_sdk [ot_border_router_setup]: https://openthread.io/guides/border-router/beaglebone-black [qr_code_generator]: https://dhrishi.github.io/connectedhomeip/qrcode.html diff --git a/examples/pump-app/cc13x2x7_26x2x7/chip.syscfg b/examples/pump-app/cc13x2x7_26x2x7/chip.syscfg index c93e60f4846aaa..38a53e57d500fd 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/chip.syscfg +++ b/examples/pump-app/cc13x2x7_26x2x7/chip.syscfg @@ -17,198 +17,191 @@ * limitations under the License. */ -/* Modules */ -var AESCCM = scripting.addModule("/ti/drivers/AESCCM"); -var AESECB = scripting.addModule("/ti/drivers/AESECB"); -var Button = scripting.addModule("/ti/drivers/apps/Button"); -var ECJPAKE = scripting.addModule("/ti/drivers/ECJPAKE"); -var LED = scripting.addModule("/ti/drivers/apps/LED"); -var NVS = scripting.addModule("/ti/drivers/NVS"); -var RF = scripting.addModule("/ti/drivers/RF"); -var RFDesign = scripting.addModule("ti/devices/radioconfig/rfdesign"); -var RTOS = scripting.addModule("/ti/drivers/RTOS"); -var TRNG = scripting.addModule("/ti/drivers/TRNG"); -var Thread = scripting.addModule("/ti/thread/thread"); -var SHA2 = scripting.addModule("/ti/drivers/SHA2"); -var UART = scripting.addModule("/ti/drivers/UART"); -var ble = scripting.addModule("/ti/ble5stack/ble"); -var dmm = scripting.addModule("/ti/dmm/dmm"); -var AESCTRDRBG = scripting.addModule("/ti/drivers/AESCTRDRBG"); -var ECDH = scripting.addModule("/ti/drivers/ECDH"); - -/* Instances */ -var AESCCM1 = AESCCM.addInstance(); -var AESCCM2 = AESCCM.addInstance(); -var AESECB1 = AESECB.addInstance(); -var AESECB2 = AESECB.addInstance(); -var Button1 = Button.addInstance(); -var Button2 = Button.addInstance(); -var ECJPAKE = ECJPAKE.addInstance(); -var NVS1 = NVS.addInstance(); -var SHA21 = SHA2.addInstance(); -var LED1 = LED.addInstance(); -var LED2 = LED.addInstance(); -var TRNG1 = TRNG.addInstance(); -var TRNG2 = TRNG.addInstance(); -var TRNG3 = TRNG.addInstance(); -var UART1 = UART.addInstance(); -var UART2 = UART.addInstance(); -var AESCTRDRBG1 = AESCTRDRBG.addInstance(); -var ECDH1 = ECDH.addInstance(); -var ECDH2 = ECDH.addInstance(); +/** + * These arguments were used when this file was generated. They will be automatically applied on subsequent loads + * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. + * @cliArgs --board "/ti/boards/CC26X2R1_LAUNCHXL" --product "simplelink_cc13x2_26x2_sdk@4.40.05.02_eng" + * @versions {"tool":"1.9.0+2015","templates":null} + */ -AESCTRDRBG1.$name = "CONFIG_AESCTRDRBG_0"; -AESCTRDRBG1.aesctrObject.$name = "CONFIG_AESCTR_0"; +/** + * Import the modules used in this configuration. + */ +const ble = scripting.addModule("/ti/ble5stack/ble"); +const CCFG = scripting.addModule("/ti/devices/CCFG"); +const rfdesign = scripting.addModule("/ti/devices/radioconfig/rfdesign"); +const dmm = scripting.addModule("/ti/dmm/dmm"); +const AESCCM = scripting.addModule("/ti/drivers/AESCCM"); +const AESCCM1 = AESCCM.addInstance(); +const AESCCM2 = AESCCM.addInstance(); +const AESCTRDRBG = scripting.addModule("/ti/drivers/AESCTRDRBG"); +const AESCTRDRBG1 = AESCTRDRBG.addInstance(); +const AESECB = scripting.addModule("/ti/drivers/AESECB"); +const AESECB1 = AESECB.addInstance(); +const AESECB2 = AESECB.addInstance(); +const ECDH = scripting.addModule("/ti/drivers/ECDH"); +const ECDH1 = ECDH.addInstance(); +const ECDH2 = ECDH.addInstance(); +const ECJPAKE = scripting.addModule("/ti/drivers/ECJPAKE"); +const ECJPAKE1 = ECJPAKE.addInstance(); +const NVS = scripting.addModule("/ti/drivers/NVS"); +const NVS1 = NVS.addInstance(); +const RF = scripting.addModule("/ti/drivers/RF"); +const RTOS = scripting.addModule("/ti/drivers/RTOS"); +const SHA2 = scripting.addModule("/ti/drivers/SHA2"); +const SHA21 = SHA2.addInstance(); +const TRNG = scripting.addModule("/ti/drivers/TRNG"); +const TRNG1 = TRNG.addInstance(); +const TRNG2 = TRNG.addInstance(); +const TRNG3 = TRNG.addInstance(); +const UART = scripting.addModule("/ti/drivers/UART"); +const UART1 = UART.addInstance(); +const UART2 = UART.addInstance(); +const Button = scripting.addModule("/ti/drivers/apps/Button"); +const Button1 = Button.addInstance(); +const Button2 = Button.addInstance(); +const LED = scripting.addModule("/ti/drivers/apps/LED"); +const LED1 = LED.addInstance(); +const LED2 = LED.addInstance(); +const thread = scripting.addModule("/ti/thread/thread"); + +/** + * Write custom configuration values to the imported modules. + */ +ble.maxConnNum = 1; +ble.numOfAdvSets = 1; +ble.lockProject = true; +ble.maxPDUSize = 255; +ble.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param1"; +ble.connUpdateParamsPeripheral.$name = "ti_ble5stack_general_ble_conn_update_params0"; +ble.connUpdateParamsPeripheral.reqMinConnInt = 30; +ble.connUpdateParamsPeripheral.reqMaxConnInt = 50; +ble.advSet1.$name = "ti_ble5stack_broadcaster_advertisement_set0"; +ble.advSet1.advParam1.$name = "ti_ble5stack_broadcaster_advertisement_params0"; +ble.advSet1.advParam1.primIntMax = 200; +ble.advSet1.advData1.$name = "ti_ble5stack_broadcaster_advertisement_data0"; +ble.advSet1.scanRes1.$name = "ti_ble5stack_broadcaster_advertisement_data1"; + +CCFG.enableBootloader = true; +CCFG.enableBootloaderBackdoor = true; +CCFG.dioBootloaderBackdoor = 13; +CCFG.levelBootloaderBackdoor = "Active low"; +CCFG.srcClkLF = "Derived from HF XOSC"; +CCFG.ccfgTemplate.$name = "ti_devices_CCFGTemplate0"; + +dmm.project = "ti_thread_thermostat_remote_display"; +dmm.stackRoles = ["blePeripheral","threadFTD"]; +dmm.lockStackRoles = true; +dmm.numApplicationStates = 10; +dmm.applicationState0 = "ANY"; +dmm.applicationState1 = "DMMPOLICY_BLE_IDLE"; +dmm.applicationState2 = "DMMPOLICY_BLE_ADV"; +dmm.applicationState3 = "DMMPOLICY_BLE_CONNECTING"; +dmm.applicationState4 = "DMMPOLICY_BLE_HIGH_BANDWIDTH"; +dmm.applicationState5 = "DMMPOLICY_BLE_CONNECTED"; +dmm.applicationState6 = "DMMPOLICY_BLE_OAD"; +dmm.applicationState7 = "DMMPOLICY_THREAD_IDLE"; +dmm.applicationState8 = "DMMPOLICY_THREAD_LINK_EST"; +dmm.applicationState9 = "DMMPOLICY_THREAD_DATA"; +dmm.policyArray.create(4); +dmm.policyArray[0].$name = "ti_dmm_policy_dmm_policy0"; +dmm.policyArray[0].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble0"; +dmm.policyArray[0].blePeripheral.applicationStates = ["applicationState6"]; +dmm.policyArray[0].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread0"; +dmm.policyArray[0].threadFTD.pause = "DMMPOLICY_PAUSED"; +dmm.policyArray[1].$name = "ti_dmm_policy_dmm_policy1"; +dmm.policyArray[1].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble1"; +dmm.policyArray[1].blePeripheral.applicationStates = ["applicationState3","applicationState4"]; +dmm.policyArray[1].blePeripheral.weight = 25; +dmm.policyArray[1].blePeripheral.appliedActivity = ["DMMPOLICY_APPLIED_ACTIVITY_BLE_CONNECTION"]; +dmm.policyArray[1].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread1"; +dmm.policyArray[2].$name = "ti_dmm_policy_dmm_policy2"; +dmm.policyArray[2].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble2"; +dmm.policyArray[2].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread2"; +dmm.policyArray[2].threadFTD.weight = 30; +dmm.policyArray[2].threadFTD.applicationStates = ["applicationState8"]; +dmm.policyArray[2].threadFTD.appliedActivity = ["DMMPOLICY_APPLIED_ACTIVITY_ALL"]; +dmm.policyArray[3].$name = "ti_dmm_policy_dmm_policy3"; +dmm.policyArray[3].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble3"; +dmm.policyArray[3].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread3"; +dmm.policyArray[3].threadFTD.weight = 1; AESCCM1.$name = "CONFIG_AESCCM0"; + AESCCM2.$name = "CONFIG_AESCCM_1"; +AESCTRDRBG1.$name = "CONFIG_AESCTRDRBG_0"; +AESCTRDRBG1.aesctrObject.$name = "CONFIG_AESCTR_0"; + AESECB1.$name = "CONFIG_AESECB0"; + AESECB2.$name = "CONFIG_AESECB_1"; ECDH1.$name = "CONFIG_ECDH0"; + ECDH2.$name = "CONFIG_ECDH_1"; -/* RTOS */ -RTOS.name = "FreeRTOS"; +ECJPAKE1.$name = "CONFIG_ECJPAKE_0"; -/* Left Button */ -Button1.$name = "CONFIG_BTN_LEFT"; -Button1.$hardware = system.deviceData.board.components["BTN-1"]; -Button1.gpioPin.$name = "CONFIG_GPIO_BTN1"; -Button1.gpioPin.pull = "Pull Up"; -Button1.gpioPin.interruptTrigger = "Falling Edge"; -Button1.gpioPin.pinInstance.$name = "CONFIG_PIN_BTN1"; - -/* Left Button */ -Button2.$name = "CONFIG_BTN_RIGHT"; -Button2.$hardware = system.deviceData.board.components["BTN-2"]; -Button2.gpioPin.$name = "CONFIG_GPIO_BTN2"; -Button2.gpioPin.pull = "Pull Up"; -Button2.gpioPin.interruptTrigger = "Falling Edge"; -Button2.gpioPin.pinInstance.$name = "CONFIG_PIN_BTN2"; - -/* ======== CCFG ======== */ -var CCFG = scripting.addModule("/ti/devices/CCFG"); -const deviceName = system.getScript("/ti/ti154stack/ti154stack_common.js").getLaunchPadFromDevice(); -const ccfgSettings = system.getScript("/ti/common/lprf_ccfg_settings.js").ccfgSettings; -for(var setting in ccfgSettings) -{ - CCFG[setting] = ccfgSettings[setting]; -} - -// Update LF Clock Source for CC2652RB devices -if(deviceName.includes("RB")) -{ - CCFG.srcClkLF = "Derived from HF XOSC"; -} -/* NVS */ -NVS1.$name = "CONFIG_NVSINTERNAL"; +NVS1.$name = "CONFIG_NVSINTERNAL"; +NVS1.internalFlash.$name = "ti_drivers_nvs_NVSCC26XX0"; NVS1.internalFlash.regionBase = 0x78000; NVS1.internalFlash.regionSize = 0x4000; -/* RF */ -RF.$name = "CONFIG_RF0"; -/* if an antenna component exists, assign it to the rf instance */ -if (system.deviceData.board && system.deviceData.board.components.RF) { - RF.$hardware = system.deviceData.board.components.RF; -} - -const rfDesignSettings = system.getScript("/ti/common/lprf_rf_design_settings.js").rfDesignSettings; -for(var setting in rfDesignSettings) -{ - RFDesign[setting] = rfDesignSettings[setting]; -} - -/* Red LED */ -LED1.$name = "CONFIG_LED_RED"; -LED1.$hardware = system.deviceData.board.components.LED_RED; -LED1.gpioPin.$name = "CONFIG_GPIO_RLED"; -LED1.gpioPin.mode = "Output"; -LED1.gpioPin.callbackFunction = ""; -LED1.gpioPin.pinInstance.$name = "CONFIG_PIN_RLED"; - -/* Green LED */ -LED2.$name = "CONFIG_LED_GREEN"; -LED2.$hardware = system.deviceData.board.components.LED_GREEN; -LED2.gpioPin.$name = "CONFIG_GPIO_GLED"; -LED2.gpioPin.mode = "Output"; -LED2.gpioPin.callbackFunction = ""; -LED2.gpioPin.pinInstance.$name = "CONFIG_PIN_GLED"; - -/* Debug UART */ -UART1.$hardware = system.deviceData.board.components.XDS110UART; -UART1.$name = "CONFIG_UART_DEBUG"; - -/* Display UART */ -UART2.$name = "CONFIG_DISPLAY_UART"; -UART2.uart.txPin.$suggestSolution = "boosterpack.32"; -UART2.uart.rxPin.$suggestSolution = "boosterpack.18"; - -/* TRNG */ -TRNG1.$name = "CONFIG_TRNG_0"; -TRNG2.$name = "CONFIG_TRNG_1"; -TRNG3.$name = "CONFIG_TRNG_APP"; - -/* Thread */ -Thread.deviceType = "ftd"; -Thread.deviceTypeReadOnly = true; -/* Thread SysConfig generated sources are not used until the upstream modules - * can be updated to enable CHIP. - */ RTOS.name = "FreeRTOS"; -/* BLE */ -ble.addressMode = "ADDRMODE_RP_WITH_PUBLIC_ID"; -ble.maxConnNum = 1; -ble.numOfAdvSets = 1; -ble.lockProject = true; -ble.oneLibSizeOpt = true; -ble.maxPDUSize = 255; -ble.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param1"; -ble.connUpdateParamsPeripheral.$name = "ti_ble5stack_general_ble_conn_update_params0"; -ble.connUpdateParamsPeripheral.reqMinConnInt = 30; -ble.connUpdateParamsPeripheral.reqMaxConnInt = 50; - -ble.advSet1.$name = "ti_ble5stack_broadcaster_advertisement_set0"; -ble.advSet1.advParam1.$name = "ti_ble5stack_broadcaster_advertisement_params0"; -ble.advSet1.advParam1.primIntMin = 100; -ble.advSet1.advParam1.primIntMax = 200; - -/* DMM */ -dmm.project = "ti_thread_thermostat_remote_display"; -dmm.stackRoles = ["blePeripheral","threadFTD"]; -dmm.lockStackRoles = true; -dmm.numApplicationStates = 10; -dmm.applicationState0 = "ANY"; -dmm.applicationState1 = "DMMPOLICY_BLE_IDLE"; -dmm.applicationState2 = "DMMPOLICY_BLE_ADV"; -dmm.applicationState3 = "DMMPOLICY_BLE_CONNECTING"; -dmm.applicationState4 = "DMMPOLICY_BLE_HIGH_BANDWIDTH"; -dmm.applicationState5 = "DMMPOLICY_BLE_CONNECTED"; -dmm.applicationState6 = "DMMPOLICY_BLE_OAD"; -dmm.applicationState7 = "DMMPOLICY_THREAD_IDLE"; -dmm.applicationState8 = "DMMPOLICY_THREAD_LINK_EST"; -dmm.applicationState9 = "DMMPOLICY_THREAD_DATA"; -dmm.policyArray.create(4); -dmm.policyArray[0].$name = "ti_dmm_policy_dmm_policy0"; -dmm.policyArray[0].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble0"; -dmm.policyArray[0].blePeripheral.applicationStates = ["applicationState6"]; -dmm.policyArray[0].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread0"; -dmm.policyArray[0].threadFTD.pause = "DMMPOLICY_PAUSED"; -dmm.policyArray[1].$name = "ti_dmm_policy_dmm_policy1"; -dmm.policyArray[1].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble1"; -dmm.policyArray[1].blePeripheral.applicationStates = ["applicationState3","applicationState4"]; -dmm.policyArray[1].blePeripheral.weight = 25; -dmm.policyArray[1].blePeripheral.appliedActivity = ["DMMPOLICY_APPLIED_ACTIVITY_BLE_CONNECTION"]; -dmm.policyArray[1].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread1"; -dmm.policyArray[2].$name = "ti_dmm_policy_dmm_policy2"; -dmm.policyArray[2].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble2"; -dmm.policyArray[2].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread2"; -dmm.policyArray[2].threadFTD.weight = 30; -dmm.policyArray[2].threadFTD.applicationStates = ["applicationState8"]; -dmm.policyArray[2].threadFTD.appliedActivity = ["DMMPOLICY_APPLIED_ACTIVITY_ALL"]; -dmm.policyArray[3].$name = "ti_dmm_policy_dmm_policy3"; -dmm.policyArray[3].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble3"; -dmm.policyArray[3].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread3"; -dmm.policyArray[3].threadFTD.weight = 1; +SHA21.$name = "CONFIG_SHA2_0"; + +TRNG1.$name = "CONFIG_TRNG_0"; + +TRNG2.$name = "CONFIG_TRNG_1"; + +TRNG3.$name = "CONFIG_TRNG_APP"; + +UART1.$name = "CONFIG_UART_DEBUG"; +UART1.uart.$assign = "UART1"; +UART1.uart.txPin.$assign = "boosterpack.4"; +UART1.uart.rxPin.$assign = "boosterpack.3"; +UART1.txPinInstance.$name = "CONFIG_PIN_4"; +UART1.rxPinInstance.$name = "CONFIG_PIN_5"; + +UART2.$name = "CONFIG_DISPLAY_UART"; +UART2.txPinInstance.$name = "CONFIG_PIN_6"; +UART2.rxPinInstance.$name = "CONFIG_PIN_7"; + +Button1.$name = "CONFIG_BTN_LEFT"; +Button1.gpioPin.$name = "CONFIG_GPIO_BTN1"; +Button1.gpioPin.gpioPin.$assign = "boosterpack.32"; +Button1.gpioPin.pinInstance.$name = "CONFIG_PIN_BTN1"; + +Button2.$name = "CONFIG_BTN_RIGHT"; +Button2.gpioPin.$name = "CONFIG_GPIO_BTN2"; +Button2.gpioPin.gpioPin.$assign = "boosterpack.13"; +Button2.gpioPin.pinInstance.$name = "CONFIG_PIN_BTN2"; + +LED1.$name = "CONFIG_LED_RED"; +LED1.gpioPin.$name = "CONFIG_GPIO_RLED"; +LED1.gpioPin.gpioPin.$assign = "boosterpack.10"; +LED1.gpioPin.pinInstance.$name = "CONFIG_PIN_RLED"; + +LED2.$name = "CONFIG_LED_GREEN"; +LED2.gpioPin.$name = "CONFIG_GPIO_GLED"; +LED2.gpioPin.gpioPin.$assign = "boosterpack.39"; +LED2.gpioPin.pinInstance.$name = "CONFIG_PIN_GLED"; + +thread.deviceTypeReadOnly = true; +thread.pm.$name = "ti_thread_pm_thread_pm0"; +thread.rf.$name = "ti_thread_rf_thread_rf0"; +thread.rf.radioConfig.$name = "ti_devices_radioconfig_settings_ieee_15_40"; +thread.rf.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0"; +thread.network.$name = "ti_thread_network_thread_network0"; +thread.security.$name = "ti_thread_security_thread_security0"; + +/** + * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future + * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to + * re-solve from scratch. + */ +UART2.uart.$suggestSolution = "UART0"; +UART2.uart.txPin.$suggestSolution = "boosterpack.30"; +UART2.uart.rxPin.$suggestSolution = "boosterpack.29"; diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp index 50a0d017ecfc80..4776cc0b773fab 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp +++ b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp @@ -22,10 +22,17 @@ #include "AppEvent.h" #include +#include +#include +#include +#include + +#include "FreeRTOS.h" #include #include -#include "FreeRTOS.h" +#include +#include #include #include @@ -33,8 +40,6 @@ #include -//#include - #include #include @@ -47,6 +52,7 @@ using namespace ::chip::Credentials; using namespace ::chip::DeviceLayer; +using namespace ::chip::app::Clusters; static TaskHandle_t sAppTaskHandle; static QueueHandle_t sAppEventQueue; @@ -84,7 +90,7 @@ int AppTask::StartAppTask() int AppTask::Init() { LED_Params ledParams; - Button_Params buttionParams; + Button_Params buttonParams; ConnectivityManager::ThreadPollingConfig pollingConfig; cc13x2_26x2LogInit(); @@ -167,18 +173,18 @@ int AppTask::Init() PLAT_LOG("Initialize buttons"); Button_init(); - Button_Params_init(&buttionParams); - buttionParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED; - buttionParams.longPressDuration = 1000U; // ms - sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, ButtonLeftEventHandler, &buttionParams); + Button_Params_init(&buttonParams); + buttonParams.buttonEventMask = Button_EV_CLICKED; + buttonParams.longPressDuration = 1000U; // ms + sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, ButtonLeftEventHandler, &buttonParams); - Button_Params_init(&buttionParams); - buttionParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED; - buttionParams.longPressDuration = 1000U; // ms - sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, ButtonRightEventHandler, &buttionParams); + Button_Params_init(&buttonParams); + buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGPRESSED; + buttonParams.longPressDuration = 5000U; // ms + sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, ButtonRightEventHandler, &buttonParams); - // Initialize BoltLock module - PLAT_LOG("Initialize BoltLock"); + // Initialize Pump module + PLAT_LOG("Initialize Pump"); PumpMgr().Init(); PumpMgr().SetCallbacks(ActionInitiated, ActionCompleted); @@ -224,10 +230,7 @@ void AppTask::ButtonLeftEventHandler(Button_Handle handle, Button_EventMask even { event.ButtonEvent.Type = AppEvent::kAppEventButtonType_Clicked; } - else if (events & Button_EV_LONGCLICKED) - { - event.ButtonEvent.Type = AppEvent::kAppEventButtonType_LongClicked; - } + // button callbacks are in ISR context if (xQueueSendFromISR(sAppEventQueue, &event, NULL) != pdPASS) { @@ -244,9 +247,9 @@ void AppTask::ButtonRightEventHandler(Button_Handle handle, Button_EventMask eve { event.ButtonEvent.Type = AppEvent::kAppEventButtonType_Clicked; } - else if (events & Button_EV_LONGCLICKED) + else if (events & Button_EV_LONGPRESSED) { - event.ButtonEvent.Type = AppEvent::kAppEventButtonType_LongClicked; + event.ButtonEvent.Type = AppEvent::kAppEventButtonType_LongPressed; } // button callbacks are in ISR context if (xQueueSendFromISR(sAppEventQueue, &event, NULL) != pdPASS) @@ -257,16 +260,16 @@ void AppTask::ButtonRightEventHandler(Button_Handle handle, Button_EventMask eve void AppTask::ActionInitiated(PumpManager::Action_t aAction, int32_t aActor) { - // If the action has been initiated by the lock, update the bolt lock trait + // If the action has been initiated by the pump, update the pump trait // and start flashing the LEDs rapidly to indicate action initiation. - if (aAction == PumpManager::LOCK_ACTION) + if (aAction == PumpManager::START_ACTION) { - PLAT_LOG("Lock initiated"); + PLAT_LOG("Pump start initiated"); ; // TODO } - else if (aAction == PumpManager::UNLOCK_ACTION) + else if (aAction == PumpManager::STOP_ACTION) { - PLAT_LOG("Unlock initiated"); + PLAT_LOG("Stop initiated"); ; // TODO } @@ -278,20 +281,20 @@ void AppTask::ActionInitiated(PumpManager::Action_t aAction, int32_t aActor) void AppTask::ActionCompleted(PumpManager::Action_t aAction) { - // if the action has been completed by the lock, update the bolt lock trait. - // Turn on the lock LED if in a LOCKED state OR - // Turn off the lock LED if in an UNLOCKED state. - if (aAction == PumpManager::LOCK_ACTION) + // if the action has been completed by the pump, update the pump trait. + // Turn on the pump state LED if in a STARTED state OR + // Turn off the pump state LED if in an STOPPED state. + if (aAction == PumpManager::START_ACTION) { - PLAT_LOG("Lock completed"); + PLAT_LOG("Pump start completed"); LED_stopBlinking(sAppGreenHandle); LED_setOn(sAppGreenHandle, LED_BRIGHTNESS_MAX); LED_stopBlinking(sAppRedHandle); LED_setOn(sAppRedHandle, LED_BRIGHTNESS_MAX); } - else if (aAction == PumpManager::UNLOCK_ACTION) + else if (aAction == PumpManager::STOP_ACTION) { - PLAT_LOG("Unlock completed"); + PLAT_LOG("Pump stop completed"); LED_stopBlinking(sAppGreenHandle); LED_setOff(sAppGreenHandle); LED_stopBlinking(sAppRedHandle); @@ -306,18 +309,14 @@ void AppTask::DispatchEvent(AppEvent * aEvent) case AppEvent::kEventType_ButtonLeft: if (AppEvent::kAppEventButtonType_Clicked == aEvent->ButtonEvent.Type) { - if (!PumpMgr().IsUnlocked()) + // Toggle Pump state + if (!PumpMgr().IsStopped()) { - PumpMgr().InitiateAction(0, PumpManager::UNLOCK_ACTION); + PumpMgr().InitiateAction(0, PumpManager::STOP_ACTION); } - } - else if (AppEvent::kAppEventButtonType_LongClicked == aEvent->ButtonEvent.Type) - { - // Disable BLE advertisements - if (ConnectivityMgr().IsBLEAdvertisingEnabled()) + else { - ConnectivityMgr().SetBLEAdvertisingEnabled(false); - PLAT_LOG("Disabled BLE Advertisements"); + PumpMgr().InitiateAction(0, PumpManager::START_ACTION); } } break; @@ -325,14 +324,7 @@ void AppTask::DispatchEvent(AppEvent * aEvent) case AppEvent::kEventType_ButtonRight: if (AppEvent::kAppEventButtonType_Clicked == aEvent->ButtonEvent.Type) { - if (PumpMgr().IsUnlocked()) - { - PumpMgr().InitiateAction(0, PumpManager::LOCK_ACTION); - } - } - else if (AppEvent::kAppEventButtonType_LongClicked == aEvent->ButtonEvent.Type) - { - // Enable BLE advertisements + // Toggle BLE advertisements if (!ConnectivityMgr().IsBLEAdvertisingEnabled()) { if (chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() == CHIP_NO_ERROR) @@ -344,6 +336,16 @@ void AppTask::DispatchEvent(AppEvent * aEvent) PLAT_LOG("OpenBasicCommissioningWindow() failed"); } } + else + { + // Disable BLE advertisements + ConnectivityMgr().SetBLEAdvertisingEnabled(false); + PLAT_LOG("Disabled BLE Advertisements"); + } + } + else if (AppEvent::kAppEventButtonType_LongPressed == aEvent->ButtonEvent.Type) + { + ConfigurationMgr().InitiateFactoryReset(); } break; @@ -359,3 +361,111 @@ void AppTask::DispatchEvent(AppEvent * aEvent) break; } } + +void AppTask::UpdateClusterState() +{ + EmberStatus status; + + ChipLogProgress(NotSpecified, "UpdateClusterState"); + + // write the new values + + bool onOffState = !PumpMgr().IsStopped(); + + status = OnOff::Attributes::OnOff::Set(1, onOffState); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating On/Off state %" PRIx8, status); + } + + int16_t maxPressure = PumpMgr().GetMaxPressure(); + status = PumpConfigurationAndControl::Attributes::MaxPressure::Set(1, maxPressure); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating MaxPressure %" PRIx8, status); + } + + uint16_t maxSpeed = PumpMgr().GetMaxSpeed(); + status = PumpConfigurationAndControl::Attributes::MaxSpeed::Set(1, maxSpeed); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating MaxSpeed %" PRIx8, status); + } + + uint16_t maxFlow = PumpMgr().GetMaxFlow(); + status = PumpConfigurationAndControl::Attributes::MaxFlow::Set(1, maxFlow); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating MaxFlow %" PRIx8, status); + } + + int16_t minConstPress = PumpMgr().GetMinConstPressure(); + status = PumpConfigurationAndControl::Attributes::MinConstPressure::Set(1, minConstPress); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating MinConstPressure %" PRIx8, status); + } + + int16_t maxConstPress = PumpMgr().GetMaxConstPressure(); + status = PumpConfigurationAndControl::Attributes::MaxConstPressure::Set(1, maxConstPress); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating MaxConstPressure %" PRIx8, status); + } + + int16_t minCompPress = PumpMgr().GetMinCompPressure(); + status = PumpConfigurationAndControl::Attributes::MinCompPressure::Set(1, minCompPress); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating MinCompPressure %" PRIx8, status); + } + + int16_t maxCompPress = PumpMgr().GetMaxCompPressure(); + status = PumpConfigurationAndControl::Attributes::MaxCompPressure::Set(1, maxCompPress); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating MaxCompPressure %" PRIx8, status); + } + + uint16_t minConstSpeed = PumpMgr().GetMinConstSpeed(); + status = PumpConfigurationAndControl::Attributes::MinConstSpeed::Set(1, minConstSpeed); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating MinConstSpeed %" PRIx8, status); + } + + uint16_t maxConstSpeed = PumpMgr().GetMaxConstSpeed(); + status = PumpConfigurationAndControl::Attributes::MaxConstSpeed::Set(1, maxConstSpeed); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating MaxConstSpeed %" PRIx8, status); + } + + uint16_t minConstFlow = PumpMgr().GetMinConstFlow(); + status = PumpConfigurationAndControl::Attributes::MinConstFlow::Set(1, minConstFlow); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating MinConstFlow %" PRIx8, status); + } + + uint16_t maxConstFlow = PumpMgr().GetMaxConstFlow(); + status = PumpConfigurationAndControl::Attributes::MaxConstFlow::Set(1, maxConstFlow); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating MaxConstFlow %" PRIx8, status); + } + + int16_t minConstTemp = PumpMgr().GetMinConstTemp(); + status = PumpConfigurationAndControl::Attributes::MinConstTemp::Set(1, minConstTemp); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating MinConstTemp %" PRIx8, status); + } + + int16_t maxConstTemp = PumpMgr().GetMaxConstTemp(); + status = PumpConfigurationAndControl::Attributes::MaxConstTemp::Set(1, maxConstTemp); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %" PRIx8, status); + } +} diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/PumpManager.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/PumpManager.cpp index 7869171d77f1f0..73e638fcceb348 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/PumpManager.cpp +++ b/examples/pump-app/cc13x2x7_26x2x7/main/PumpManager.cpp @@ -25,7 +25,7 @@ #define ACTUATOR_MOVEMENT_PERIOS_MS 500 -PumpManager PumpManager::sLock; +PumpManager PumpManager::sPump; int PumpManager::Init() { @@ -34,15 +34,15 @@ int PumpManager::Init() mTimerHandle = xTimerCreate("BLT_TIMER", pdMS_TO_TICKS(ACTUATOR_MOVEMENT_PERIOS_MS), pdFALSE, this, TimerEventHandler); if (NULL == mTimerHandle) { - PLAT_LOG("failed to create bolt lock timer"); + PLAT_LOG("failed to create pump timer"); while (1) ; } - mState = kState_LockingCompleted; - mAutoLockTimerArmed = false; - mAutoRelock = false; - mAutoLockDuration = 0; + mState = kState_StopCompleted; + mAutoStartTimerArmed = false; + mAutoRestart = false; + mAutoStartDuration = 0; return ret; } @@ -55,22 +55,22 @@ void PumpManager::SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callba bool PumpManager::IsActionInProgress() { - return (mState == kState_LockingInitiated || mState == kState_UnlockingInitiated); + return (mState == kState_StartInitiated || mState == kState_StopInitiated); } -bool PumpManager::IsUnlocked() +bool PumpManager::IsStopped() { - return (mState == kState_UnlockingCompleted); + return (mState == kState_StopCompleted); } -void PumpManager::EnableAutoRelock(bool aOn) +void PumpManager::EnableAutoRestart(bool aOn) { - mAutoRelock = aOn; + mAutoRestart = aOn; } -void PumpManager::SetAutoLockDuration(uint32_t aDurationInSecs) +void PumpManager::SetAutoStartDuration(uint32_t aDurationInSecs) { - mAutoLockDuration = aDurationInSecs; + mAutoStartDuration = aDurationInSecs; } bool PumpManager::InitiateAction(int32_t aActor, Action_t aAction) @@ -78,32 +78,32 @@ bool PumpManager::InitiateAction(int32_t aActor, Action_t aAction) bool action_initiated = false; State_t new_state; - // Initiate Lock/Unlock Action only when the previous one is complete. - if (mState == kState_LockingCompleted && aAction == UNLOCK_ACTION) + // Initiate Start/Stop Action only when the previous one is complete. + if (mState == kState_StartCompleted && aAction == STOP_ACTION) { action_initiated = true; - new_state = kState_UnlockingInitiated; + new_state = kState_StopInitiated; } - else if (mState == kState_UnlockingCompleted && aAction == LOCK_ACTION) + else if (mState == kState_StopCompleted && aAction == START_ACTION) { action_initiated = true; - new_state = kState_LockingInitiated; + new_state = kState_StartInitiated; } if (action_initiated) { - if (mAutoLockTimerArmed && new_state == kState_LockingInitiated) + if (mAutoStartTimerArmed && new_state == kState_StartInitiated) { - // If auto lock timer has been armed and someone initiates locking, + // If auto start timer has been armed and someone initiates start, // cancel the timer and continue as normal. - mAutoLockTimerArmed = false; + mAutoStartTimerArmed = false; CancelTimer(); } - StartTimer(ACTUATOR_MOVEMENT_PERIOS_MS); + PumpTimer(ACTUATOR_MOVEMENT_PERIOS_MS); // Since the timer started successfully, update the state and trigger callback mState = new_state; @@ -117,7 +117,7 @@ bool PumpManager::InitiateAction(int32_t aActor, Action_t aAction) return action_initiated; } -void PumpManager::StartTimer(uint32_t aTimeoutMs) +void PumpManager::PumpTimer(uint32_t aTimeoutMs) { xTimerChangePeriod(mTimerHandle, pdMS_TO_TICKS(aTimeoutMs), 100); xTimerStart(mTimerHandle, 100); @@ -130,17 +130,17 @@ void PumpManager::CancelTimer(void) void PumpManager::TimerEventHandler(TimerHandle_t aTimer) { - PumpManager * lock = static_cast(pvTimerGetTimerID(aTimer)); + PumpManager * pump = static_cast(pvTimerGetTimerID(aTimer)); // The timer event handler will be called in the context of the timer task - // once sLockTimer expires. Post an event to apptask queue with the actual handler + // once sPumpTimer expires. Post an event to apptask queue with the actual handler // so that the event can be handled in the context of the apptask. AppEvent event; - event.Type = AppEvent::kEventType_AppEvent; - event.BoltLockEvent.Context = static_cast(lock); - if (lock->mAutoLockTimerArmed) + event.Type = AppEvent::kEventType_AppEvent; + event.PumpStateEvent.Context = static_cast(pump); + if (pump->mAutoStartTimerArmed) { - event.Handler = AutoReLockTimerEventHandler; + event.Handler = AutoRestartTimerEventHandler; } else { @@ -149,56 +149,186 @@ void PumpManager::TimerEventHandler(TimerHandle_t aTimer) GetAppTask().PostEvent(&event); } -void PumpManager::AutoReLockTimerEventHandler(AppEvent * aEvent) +void PumpManager::AutoRestartTimerEventHandler(AppEvent * aEvent) { - PumpManager * lock = static_cast(aEvent->BoltLockEvent.Context); + PumpManager * pump = static_cast(aEvent->PumpStateEvent.Context); int32_t actor = 0; - // Make sure auto lock timer is still armed. - if (!lock->mAutoLockTimerArmed) + // Make sure auto start timer is still armed. + if (!pump->mAutoStartTimerArmed) { return; } - lock->mAutoLockTimerArmed = false; + pump->mAutoStartTimerArmed = false; - PLAT_LOG("Auto Re-Lock has been triggered!"); + PLAT_LOG("Auto Re-Start has been triggered!"); - lock->InitiateAction(actor, LOCK_ACTION); + pump->InitiateAction(actor, START_ACTION); } void PumpManager::ActuatorMovementTimerEventHandler(AppEvent * aEvent) { Action_t actionCompleted = INVALID_ACTION; - PumpManager * lock = static_cast(aEvent->BoltLockEvent.Context); + PumpManager * pump = static_cast(aEvent->PumpStateEvent.Context); - if (lock->mState == kState_LockingInitiated) + if (pump->mState == kState_StartInitiated) { - lock->mState = kState_LockingCompleted; - actionCompleted = LOCK_ACTION; + pump->mState = kState_StartCompleted; + actionCompleted = START_ACTION; } - else if (lock->mState == kState_UnlockingInitiated) + else if (pump->mState == kState_StopInitiated) { - lock->mState = kState_UnlockingCompleted; - actionCompleted = UNLOCK_ACTION; + pump->mState = kState_StopCompleted; + actionCompleted = STOP_ACTION; } if (actionCompleted != INVALID_ACTION) { - if (lock->mActionCompleted_CB) + if (pump->mActionCompleted_CB) { - lock->mActionCompleted_CB(actionCompleted); + pump->mActionCompleted_CB(actionCompleted); } - if (lock->mAutoRelock && actionCompleted == UNLOCK_ACTION) + if (pump->mAutoRestart && actionCompleted == STOP_ACTION) { - // Start the timer for auto relock - lock->StartTimer(lock->mAutoLockDuration * 1000); + // Start the timer for auto restart + pump->PumpTimer(pump->mAutoStartDuration * 1000); - lock->mAutoLockTimerArmed = true; + pump->mAutoStartTimerArmed = true; - PLAT_LOG("Auto Re-lock enabled. Will be triggered in %u seconds", lock->mAutoLockDuration); + PLAT_LOG("Auto Re-start enabled. Will be triggered in %u seconds", pump->mAutoStartDuration); } } } + +int16_t PumpManager::GetMaxPressure() +{ + // 1.6.1. MaxPressure Attribute + // Range -3276.7 kPa to 3276.7 kPa (steps of 0.1 kPa) + // -3276.8 is invalid value - perhaps 'null' + + // Return 2000.0 kPa as Max Pressure + return 20000; +} + +uint16_t PumpManager::GetMaxSpeed() +{ + // 1.6.2. MaxSpeed Attribute + // Range 0 RPM to 65534 RPM (steps of 1 RPM) + // 65535 is invalid value - perhaps 'null' + + // Return 1000 RPM as MaxSpeed + return 1000; +} + +uint16_t PumpManager::GetMaxFlow() +{ + // 1.6.3. MaxFlow Attribute + // Range 0 m3/h to 6553.4 m3/h (steps of 0.1 m3/h) + // 6553.5 m3/h is invalid value - perhaps 'null' + + // Return 200.0 m3/h as MaxFlow + return 2000; +} + +int16_t PumpManager::GetMinConstPressure() +{ + // 1.6.4. MinConstPressure Attribute + // Range -3276.7 kPa to 3276.7 kPa (steps of 0.1 kPa) + // -3276.8 is invalid value - perhaps 'null' + + // Return -100.0 kPa as MinConstPressure + return -1000; +} + +int16_t PumpManager::GetMaxConstPressure() +{ + // 1.6.5. MaxConstPressure Attribute + // Range -3276.7 kPa to 3276.7 kPa (steps of 0.1 kPa) + // -3276.8 is invalid value - perhaps 'null' + + // Return 100.0 kPa as MaxConstPressure + return 1000; +} + +int16_t PumpManager::GetMinCompPressure() +{ + // 1.6.6. MinCompPressure Attribute + // Range -3276.7 kPa to 3276.7 kPa (steps of 0.1 kPa) + // -3276.8 is invalid value - perhaps 'null' + + // Return -20.0 kPa as MinCompPressure + return -200; +} + +int16_t PumpManager::GetMaxCompPressure() +{ + // 1.6.7. MaxCompPressure Attribute + // Range -3276.7 kPa to 3276.7 kPa (steps of 0.1 kPa) + // -3276.8 is invalid value - perhaps 'null' + + // Return 20.0 kPa as MaxCompPressure + return 200; +} + +uint16_t PumpManager::GetMinConstSpeed() +{ + // 1.6.8. MinConstSpeed Attribute + // Range 0 to 65534 RPM (steps of 1 RPM) + // 65535 RPM is invalid valud - perhaps 'null' + + // Return 200 RPM as MinConstSpeed + return 200; +} + +uint16_t PumpManager::GetMaxConstSpeed() +{ + // 1.6.9. MaxConstSpeed Attribute + // Range 0 to 65534 RPM (steps of 1 RPM) + // 65535 RPM is invalid valud - perhaps 'null' + + // Return 2000 RPM as MaxConstSpeed + return 2000; +} + +uint16_t PumpManager::GetMinConstFlow() +{ + // 1.6.10. MinConstFlow Attribute + // Range 0 m3/h to 6553.4 m3/h (steps of 0.1 m3/h) + // 6553.5 m3/h is invalid value - perhaps 'null' + + // Return 12.5 m3/h as MinConstFlow + return 125; +} + +uint16_t PumpManager::GetMaxConstFlow() +{ + // 1.6.11. MaxConstFlow Attribute + // Range 0 m3/h to 6553.4 m3/h (steps of 0.1 m3/h) + // 6553.5 m3/h is invalid value - perhaps 'null' + + // Return 655.7 m3/h as MaxConstFlow + return 6557; +} + +int16_t PumpManager::GetMinConstTemp() +{ + // 1.6.12. MinConstTemp Attribute + // Range -273.15 C to 327.67 C (steps of 0.01 C) + // All other values are invalid values - perhaps 'null' + + // Return 30.00 C as MinConstTemp + return 3000; +} + +int16_t PumpManager::GetMaxConstTemp() +{ + // 1.6.13. MaxConstTemp Attribute + // Range -273.15 C to 327.67 C (steps of 0.01 C) + // All other values are invalid values - perhaps 'null' + + // Return 56.00 C as MaxConstTemp + return 5600; +} diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp index 8d4abc4858c4a1..4d97751ad0a190 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp +++ b/examples/pump-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp @@ -15,7 +15,10 @@ * limitations under the License. */ +#include + #include "AppConfig.h" +#include "AppTask.h" #include "PumpManager.h" #include @@ -31,7 +34,17 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & { if (attributePath.mClusterId == OnOff::Id && attributePath.mAttributeId == OnOff::Attributes::OnOff::Id) { - PumpMgr().InitiateAction(0, *value ? PumpManager::LOCK_ACTION : PumpManager::UNLOCK_ACTION); + PumpMgr().InitiateAction(0, *value ? PumpManager::START_ACTION : PumpManager::STOP_ACTION); + } + else if (attributePath.mClusterId == LevelControl::Id && + attributePath.mAttributeId == LevelControl::Attributes::CurrentLevel::Id) + { + ChipLogProgress(Zcl, "[pump-app] Cluster LevelControl: attribute CurrentLevel set to %" PRIu8, *value); + } + else + { + ChipLogProgress(Zcl, "Unknown attribute ID: " ChipLogFormatMEI, ChipLogValueMEI(attributePath.mAttributeId)); + return; } } @@ -52,5 +65,11 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & */ void emberAfOnOffClusterInitCallback(EndpointId endpoint) { - // TODO: implement any additional Cluster Server init actions + GetAppTask().UpdateClusterState(); +} + +void emberAfPumpConfigurationAndControlClusterInitCallback(chip::EndpointId endpoint) +{ + // TODO: Setup the default values in the cluster for this specific application + GetAppTask().UpdateClusterState(); } diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/include/AppEvent.h b/examples/pump-app/cc13x2x7_26x2x7/main/include/AppEvent.h index ad9e93ee3ad1a5..14c9f045231e2a 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/include/AppEvent.h +++ b/examples/pump-app/cc13x2x7_26x2x7/main/include/AppEvent.h @@ -37,6 +37,7 @@ struct AppEvent kAppEventButtonType_None = 0, kAppEventButtonType_Clicked, kAppEventButtonType_LongClicked, + kAppEventButtonType_LongPressed, }; enum AppEventType Type; @@ -51,7 +52,7 @@ struct AppEvent struct { void * Context; - } BoltLockEvent; + } PumpStateEvent; }; EventHandler Handler; diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/include/AppTask.h b/examples/pump-app/cc13x2x7_26x2x7/main/include/AppTask.h index 7c6345e1bd9c26..65fb71df49adc9 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/include/AppTask.h +++ b/examples/pump-app/cc13x2x7_26x2x7/main/include/AppTask.h @@ -37,15 +37,15 @@ class AppTask int StartAppTask(); static void AppTaskMain(void * pvParameter); - void PostLockActionRequest(int32_t aActor, PumpManager::Action_t aAction); + void PostStartActionRequest(int32_t aActor, PumpManager::Action_t aAction); void PostEvent(const AppEvent * event); + void UpdateClusterState(); private: friend AppTask & GetAppTask(void); int Init(); - // should this be done by BoltLock Manager? I don't want to unravel this spaghetti quite yet static void ActionInitiated(PumpManager::Action_t aAction, int32_t aActor); static void ActionCompleted(PumpManager::Action_t aAction); diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/include/BoltLockManager.h b/examples/pump-app/cc13x2x7_26x2x7/main/include/BoltLockManager.h deleted file mode 100644 index 40fc4ffb338a67..00000000000000 --- a/examples/pump-app/cc13x2x7_26x2x7/main/include/BoltLockManager.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef LOCK_MANAGER_H -#define LOCK_MANAGER_H - -#include -#include - -#include "AppEvent.h" - -#include -#include - -class BoltLockManager -{ -public: - enum Action_t - { - LOCK_ACTION = 0, - UNLOCK_ACTION, - - INVALID_ACTION - } Action; - - enum State_t - { - kState_LockingInitiated = 0, - kState_LockingCompleted, - kState_UnlockingInitiated, - kState_UnlockingCompleted, - } State; - - int Init(); - bool IsUnlocked(); - void EnableAutoRelock(bool aOn); - void SetAutoLockDuration(uint32_t aDurationInSecs); - bool IsActionInProgress(); - bool InitiateAction(int32_t aActor, Action_t aAction); - - typedef void (*Callback_fn_initiated)(Action_t, int32_t aActor); - typedef void (*Callback_fn_completed)(Action_t); - void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB); - -private: - friend BoltLockManager & BoltLockMgr(void); - State_t mState; - - Callback_fn_initiated mActionInitiated_CB; - Callback_fn_completed mActionCompleted_CB; - - bool mAutoRelock; - uint32_t mAutoLockDuration; - bool mAutoLockTimerArmed; - TimerHandle_t mTimerHandle; - - void CancelTimer(void); - void StartTimer(uint32_t aTimeoutMs); - - static void TimerEventHandler(TimerHandle_t aTimer); - static void AutoReLockTimerEventHandler(AppEvent * aEvent); - static void ActuatorMovementTimerEventHandler(AppEvent * aEvent); - - static BoltLockManager sLock; -}; - -inline BoltLockManager & BoltLockMgr(void) -{ - return BoltLockManager::sLock; -} - -#endif // LOCK_MANAGER_H diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index c0330d33d649df..3fbfe92feda6d7 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -28,21 +28,13 @@ #ifndef CHIP_PROJECT_CONFIG_H #define CHIP_PROJECT_CONFIG_H -#if BUILD_RELEASE // release build - -// Security and Authentication enabled for release build. +// Security and Authentication always enabled #define CHIP_CONFIG_SECURITY_TEST_MODE 0 #define CHIP_CONFIG_REQUIRE_AUTH 1 -#else // development build +#if BUILD_RELEASE // release build -// Security and Authentication disabled for development build. -// For convenience, enable CHIP Security Test Mode and disable the requirement for -// authentication in various protocols. -// WARNING: These options make it possible to circumvent basic CHIP security functionality, -// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. -#define CHIP_CONFIG_SECURITY_TEST_MODE 1 -#define CHIP_CONFIG_REQUIRE_AUTH 0 +#else // development build /** * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/include/PumpManager.h b/examples/pump-app/cc13x2x7_26x2x7/main/include/PumpManager.h index ec83d508f91c1e..62988216fec1fb 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/include/PumpManager.h +++ b/examples/pump-app/cc13x2x7_26x2x7/main/include/PumpManager.h @@ -16,8 +16,8 @@ * limitations under the License. */ -#ifndef LOCK_MANAGER_H -#define LOCK_MANAGER_H +#ifndef PUMP_MANAGER_H +#define PUMP_MANAGER_H #include #include @@ -32,27 +32,41 @@ class PumpManager public: enum Action_t { - LOCK_ACTION = 0, - UNLOCK_ACTION, + START_ACTION = 0, + STOP_ACTION, INVALID_ACTION } Action; enum State_t { - kState_LockingInitiated = 0, - kState_LockingCompleted, - kState_UnlockingInitiated, - kState_UnlockingCompleted, + kState_StartInitiated = 0, + kState_StartCompleted, + kState_StopInitiated, + kState_StopCompleted, } State; int Init(); - bool IsUnlocked(); - void EnableAutoRelock(bool aOn); - void SetAutoLockDuration(uint32_t aDurationInSecs); + bool IsStopped(); + void EnableAutoRestart(bool aOn); + void SetAutoStartDuration(uint32_t aDurationInSecs); bool IsActionInProgress(); bool InitiateAction(int32_t aActor, Action_t aAction); + int16_t GetMaxPressure(); + uint16_t GetMaxSpeed(); + uint16_t GetMaxFlow(); + int16_t GetMinConstPressure(); + int16_t GetMaxConstPressure(); + int16_t GetMinCompPressure(); + int16_t GetMaxCompPressure(); + uint16_t GetMinConstSpeed(); + uint16_t GetMaxConstSpeed(); + uint16_t GetMinConstFlow(); + uint16_t GetMaxConstFlow(); + int16_t GetMinConstTemp(); + int16_t GetMaxConstTemp(); + typedef void (*Callback_fn_initiated)(Action_t, int32_t aActor); typedef void (*Callback_fn_completed)(Action_t); void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB); @@ -64,24 +78,24 @@ class PumpManager Callback_fn_initiated mActionInitiated_CB; Callback_fn_completed mActionCompleted_CB; - bool mAutoRelock; - uint32_t mAutoLockDuration; - bool mAutoLockTimerArmed; + bool mAutoRestart; + uint32_t mAutoStartDuration; + bool mAutoStartTimerArmed; TimerHandle_t mTimerHandle; void CancelTimer(void); - void StartTimer(uint32_t aTimeoutMs); + void PumpTimer(uint32_t aTimeoutMs); static void TimerEventHandler(TimerHandle_t aTimer); - static void AutoReLockTimerEventHandler(AppEvent * aEvent); + static void AutoRestartTimerEventHandler(AppEvent * aEvent); static void ActuatorMovementTimerEventHandler(AppEvent * aEvent); - static PumpManager sLock; + static PumpManager sPump; }; inline PumpManager & PumpMgr(void) { - return PumpManager::sLock; + return PumpManager::sPump; } -#endif // LOCK_MANAGER_H +#endif // PUMP_MANAGER_H diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/main.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/main.cpp index 1ed5409a721cce..03a1b6badebe6f 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/main.cpp +++ b/examples/pump-app/cc13x2x7_26x2x7/main/main.cpp @@ -37,7 +37,7 @@ #include #include -#define TOTAL_ICALL_HEAP_SIZE (0xf000) +#define TOTAL_ICALL_HEAP_SIZE (0xC000) using namespace ::chip; using namespace ::chip::Inet; @@ -77,8 +77,8 @@ int main(void) SHA2_init(); - CHIP_ERROR ret = GetAppTask().StartAppTask(); - if (ret != CHIP_NO_ERROR) + int ret = GetAppTask().StartAppTask(); + if (ret != 0) { // can't log until the kernel is started // PLAT_LOG("GetAppTask().StartAppTask() failed"); diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index 045bc54a816a1e..08e80e0f8ce056 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -3624,7 +3624,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -3639,7 +3639,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -3654,7 +3654,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -3669,7 +3669,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -3736,7 +3736,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -3751,7 +3751,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -3766,7 +3766,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -3781,7 +3781,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -3796,7 +3796,7 @@ "reportableChange": 0 }, { - "name": "scaled value", + "name": "ScaledValue", "code": 16, "mfgCode": null, "side": "server", @@ -3811,7 +3811,7 @@ "reportableChange": 0 }, { - "name": "scaled tolerance", + "name": "ScaledTolerance", "code": 19, "mfgCode": null, "side": "server", @@ -3878,7 +3878,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -3893,7 +3893,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -3908,7 +3908,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -3923,7 +3923,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -5487,7 +5487,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -5502,7 +5502,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -5517,7 +5517,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -5532,7 +5532,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -5599,7 +5599,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -5614,7 +5614,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -5629,7 +5629,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -5644,7 +5644,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -5659,7 +5659,7 @@ "reportableChange": 0 }, { - "name": "scaled value", + "name": "ScaledValue", "code": 16, "mfgCode": null, "side": "server", @@ -5674,7 +5674,7 @@ "reportableChange": 0 }, { - "name": "scaled tolerance", + "name": "ScaledTolerance", "code": 19, "mfgCode": null, "side": "server", @@ -5741,7 +5741,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -5756,7 +5756,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -5771,7 +5771,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -5786,7 +5786,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -5839,6 +5839,5 @@ "endpointVersion": 1, "deviceIdentifier": null } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/README.md b/examples/pump-controller-app/cc13x2x7_26x2x7/README.md index 5b15bef626e2a8..b252a2fce7d6a1 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/README.md +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/README.md @@ -1,11 +1,11 @@ -# CHIP CC1352 CC2652 Lock Example Application +# Matter CC1352 CC2652 Pump Controller Example Application -An example application showing the use [CHIP][chip] on the Texas Instruments -CC13X2_26X2 family of Wireless MCUs. +An example application showing the use of [Matter][matter] on the Texas +Instruments CC13X2_26X2 family of Wireless MCUs. --- -- [CHIP CC1352 CC2652 Lock Example Application](#chip-cc1352-cc2652-lock-example-application) +- [Matter CC1352 CC2652 Pump Controller Example Application](#matter-cc1352-cc2652-pump-controller-example-application) - [Introduction](#introduction) - [Device UI](#device-ui) - [Building](#building) @@ -19,7 +19,7 @@ CC13X2_26X2 family of Wireless MCUs. - [Provisioning](#provisioning) - [Bluetooth LE Advertising](#bluetooth-le-advertising) - [Bluetooth LE Rendezvous](#bluetooth-le-rendezvous) - - [CHIP Remote Commands](#chip-remote-commands) + - [Matter Remote Commands](#matter-remote-commands) - [TI Support](#ti-support) --- @@ -28,34 +28,36 @@ CC13X2_26X2 family of Wireless MCUs. ![CC1352R1_LAUNCHXL](doc/images/cc1352r1_launchxl.jpg) -The CC13X2_26X2 lock example application provides a working demonstration of a -connected door lock device. This uses the open-source CHIP implementation and -the Texas Instruments SimpleLinkâ„¢ CC13x2 and CC26x2 software development kit. +The CC13X2_26X2 pump controller example application provides a working +demonstration of a connected pump controller device. This uses the open-source +Matter implementation and the Texas Instruments SimpleLinkâ„¢ CC13x2 and CC26x2 +software development kit. This example is enabled to build for CC2652R7 devices. This upcoming devices are currently not yet in full production. For more information on device -availability or early access to an engineering build of our CHIP-enabled SDK, -please reach out [here][ti_cc13x2_26x2_r7_chip_request]. +availability or early access to an engineering build of our Matter-enabled SDK, +please reach out [here][ti_cc13x2_26x2_r7_matter_request]. -The lock example is intended to serve both as a means to explore the workings of -CHIP, as well as a template for creating real products based on the Texas +The pump 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 Texas Instruments devices. ## Device UI This example application has a simple User Interface to depict the state of the -door lock and to control the state. The user LEDs on the LaunchPad are set on -when the lock is locked, and are set off when unlocked. The LEDs will flash when -in the transition state between locked and unlocked. +pump and to control the state. The user LEDs on the LaunchPad are set on when +the pump is started, and are set off when stopped. The LEDs will flash when in +the transition state between started and stopped. -Short presses (less than 1000ms) of the user buttons are used for requesting -lock and unlock of the door lock. The left button (`BTN-1`) is used to request -locking. The right button (`BTN-2`) is used to request unlocking. +Short presses (less than 1000ms) of the left user button (`BTN-1`) are used for +toggling the pump state. -Long presses (greater than 1000ms) of the user buttons are used for controlling -BLE advertisements. The left button (`BTN-1`) is used to disable advertisements -if they are enabled. The Right button (`BTN-2`) is used to enable -advertisements. +Short presses (less than 1000ms) of the right user button (`BTN-2`) are used for +toggling Matter BLE advertisements. + +Long presses (greater than 5000ms) of the right user button (`BTN-2`) will +initiate a factory reset of the device clearing all stored provisioning +information to allow for a new network setup. ## Building @@ -65,7 +67,7 @@ Some initial setup is necessary for preparing the build environment. This section will need to be done when migrating to new versions of the SDK. - An engineering SDK from TI is required. Please request access for it - [here][ti_cc13x2_26x2_r7_chip_request]. + [here][ti_cc13x2_26x2_r7_matter_request]. - Follow the default installation instructions when executing the installer. @@ -124,7 +126,7 @@ Ninja to build the executable. `C:\ti` ``` - $ cd ~/connectedhomeip/examples/lock-app/cc13x2_26x2 + $ cd ~/connectedhomeip/examples/pump-controller-app/cc13x2_26x2 $ export TI_SIMPLELINK_SDK_ROOT= $ export TI_SYSCONFIG_ROOT= $ gn gen out/debug --args="ti_simplelink_sdk_root=\"${TI_SIMPLELINK_SDK_ROOT}\" ti_sysconfig_root=\"${TI_SYSCONFIG_ROOT}\"" @@ -168,27 +170,27 @@ Router][ot_border_router_setup]. ### Provisioning -The first step to bring the CHIP device onto the network is to provision it. Our -example accomplishes this with Bluetooth Low Energy (BLE) and the +The first step to bring the Matter device onto the network is to provision it. +Our example accomplishes this with Bluetooth Low Energy (BLE) and the [CHIPTool](../../../src/android/CHIPTool/README.md) mobile app. #### Bluetooth LE Advertising To provision this example onto a Thread network, the device must be discoverable -over Bluetooth LE. BLE advertising is started by long pressing the right button -(greater than 1000ms), labeled `BTN-2` on the silkscreen. Once the device is -fully provisioned, BLE advertising will stop. +over Bluetooth LE. BLE advertising is started by pressing the right button (less +than 1000ms), labeled `BTN-2` on the silkscreen. Once the device is fully +provisioned, BLE advertising will stop. #### Bluetooth LE Rendezvous In this example, the provisioning procedure (called Rendezvous) is done over -Bluetooth LE between a CHIP device (lock-app) and the CHIP controller -(CHIPTool), where the controller has the commissioner role. +Bluetooth LE between a Matter device (pump-controller-app) and the Matter +controller (CHIPTool), where the controller has the commissioner role. To start the rendezvous, the controller must get the commissioning information -from the CHIP device. +from the Matter device. -This is done by scanning a QR code. A URL will be displayed on the lock-app's +This is done by scanning a QR code. A URL will be displayed on the pump-app's log ([UART terminal](#viewing-logging-output)). It will look like the following: ``` @@ -202,21 +204,21 @@ pre-loaded). Alternatively, you can navigate to [the QR code generator][qr_code_generator] and enter in the payload shown in `SetupQRCode` (in this case `MT:.81TM -00 0C9SS0`). -### CHIP Remote Commands +### Matter Remote Commands -Once the CHIP device is provisioned and operating on the network, CHIPTool can -be used to control the device. During the provisioning process, the CHIP device -would have sent one of its newly assigned IPv6 addresses to the CHIPTool. +Once the Matter device is provisioned and operating on the network, CHIPTool can +be used to control the device. During the provisioning process, the Matter +device would have sent one of its newly assigned IPv6 addresses to the CHIPTool. -In the app, you should see an On/Off cluster; this corresponds to the lock-app. -You can now control the lock-app CHIP device from the smartphone! +In the app, you should see an On/Off cluster; this corresponds to the pump-app. +You can now control the pump-controller-app Matter device from the smartphone! ## TI Support For technical support, please consider creating a post on TI's [E2E forum][e2e]. Additionally, we welcome any feedback. -[chip]: https://github.com/project-chip/connectedhomeip +[matter]: https://github.com/project-chip/connectedhomeip [cc1352r1_launchxl]: https://www.ti.com/tool/LAUNCHXL-CC1352R1 [e2e]: https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread [simplelink_sdk]: https://www.ti.com/tool/SIMPLELINK-CC13X2-26X2-SDK @@ -227,7 +229,7 @@ Additionally, we welcome any feedback. http://software-dl.ti.com/ccs/esd/sysconfig/sysconfig-1.5.0_1397-setup.run [ti_thread_dnd]: https://www.ti.com/wireless-connectivity/thread/design-development.html -[ti_cc13x2_26x2_r7_chip_request]: https://ti.com/chip_sdk +[ti_cc13x2_26x2_r7_matter_request]: https://ti.com/chip_sdk [ot_border_router_setup]: https://openthread.io/guides/border-router/beaglebone-black [qr_code_generator]: https://dhrishi.github.io/connectedhomeip/qrcode.html diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/chip.syscfg b/examples/pump-controller-app/cc13x2x7_26x2x7/chip.syscfg index c93e60f4846aaa..38a53e57d500fd 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/chip.syscfg +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/chip.syscfg @@ -17,198 +17,191 @@ * limitations under the License. */ -/* Modules */ -var AESCCM = scripting.addModule("/ti/drivers/AESCCM"); -var AESECB = scripting.addModule("/ti/drivers/AESECB"); -var Button = scripting.addModule("/ti/drivers/apps/Button"); -var ECJPAKE = scripting.addModule("/ti/drivers/ECJPAKE"); -var LED = scripting.addModule("/ti/drivers/apps/LED"); -var NVS = scripting.addModule("/ti/drivers/NVS"); -var RF = scripting.addModule("/ti/drivers/RF"); -var RFDesign = scripting.addModule("ti/devices/radioconfig/rfdesign"); -var RTOS = scripting.addModule("/ti/drivers/RTOS"); -var TRNG = scripting.addModule("/ti/drivers/TRNG"); -var Thread = scripting.addModule("/ti/thread/thread"); -var SHA2 = scripting.addModule("/ti/drivers/SHA2"); -var UART = scripting.addModule("/ti/drivers/UART"); -var ble = scripting.addModule("/ti/ble5stack/ble"); -var dmm = scripting.addModule("/ti/dmm/dmm"); -var AESCTRDRBG = scripting.addModule("/ti/drivers/AESCTRDRBG"); -var ECDH = scripting.addModule("/ti/drivers/ECDH"); - -/* Instances */ -var AESCCM1 = AESCCM.addInstance(); -var AESCCM2 = AESCCM.addInstance(); -var AESECB1 = AESECB.addInstance(); -var AESECB2 = AESECB.addInstance(); -var Button1 = Button.addInstance(); -var Button2 = Button.addInstance(); -var ECJPAKE = ECJPAKE.addInstance(); -var NVS1 = NVS.addInstance(); -var SHA21 = SHA2.addInstance(); -var LED1 = LED.addInstance(); -var LED2 = LED.addInstance(); -var TRNG1 = TRNG.addInstance(); -var TRNG2 = TRNG.addInstance(); -var TRNG3 = TRNG.addInstance(); -var UART1 = UART.addInstance(); -var UART2 = UART.addInstance(); -var AESCTRDRBG1 = AESCTRDRBG.addInstance(); -var ECDH1 = ECDH.addInstance(); -var ECDH2 = ECDH.addInstance(); +/** + * These arguments were used when this file was generated. They will be automatically applied on subsequent loads + * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. + * @cliArgs --board "/ti/boards/CC26X2R1_LAUNCHXL" --product "simplelink_cc13x2_26x2_sdk@4.40.05.02_eng" + * @versions {"tool":"1.9.0+2015","templates":null} + */ -AESCTRDRBG1.$name = "CONFIG_AESCTRDRBG_0"; -AESCTRDRBG1.aesctrObject.$name = "CONFIG_AESCTR_0"; +/** + * Import the modules used in this configuration. + */ +const ble = scripting.addModule("/ti/ble5stack/ble"); +const CCFG = scripting.addModule("/ti/devices/CCFG"); +const rfdesign = scripting.addModule("/ti/devices/radioconfig/rfdesign"); +const dmm = scripting.addModule("/ti/dmm/dmm"); +const AESCCM = scripting.addModule("/ti/drivers/AESCCM"); +const AESCCM1 = AESCCM.addInstance(); +const AESCCM2 = AESCCM.addInstance(); +const AESCTRDRBG = scripting.addModule("/ti/drivers/AESCTRDRBG"); +const AESCTRDRBG1 = AESCTRDRBG.addInstance(); +const AESECB = scripting.addModule("/ti/drivers/AESECB"); +const AESECB1 = AESECB.addInstance(); +const AESECB2 = AESECB.addInstance(); +const ECDH = scripting.addModule("/ti/drivers/ECDH"); +const ECDH1 = ECDH.addInstance(); +const ECDH2 = ECDH.addInstance(); +const ECJPAKE = scripting.addModule("/ti/drivers/ECJPAKE"); +const ECJPAKE1 = ECJPAKE.addInstance(); +const NVS = scripting.addModule("/ti/drivers/NVS"); +const NVS1 = NVS.addInstance(); +const RF = scripting.addModule("/ti/drivers/RF"); +const RTOS = scripting.addModule("/ti/drivers/RTOS"); +const SHA2 = scripting.addModule("/ti/drivers/SHA2"); +const SHA21 = SHA2.addInstance(); +const TRNG = scripting.addModule("/ti/drivers/TRNG"); +const TRNG1 = TRNG.addInstance(); +const TRNG2 = TRNG.addInstance(); +const TRNG3 = TRNG.addInstance(); +const UART = scripting.addModule("/ti/drivers/UART"); +const UART1 = UART.addInstance(); +const UART2 = UART.addInstance(); +const Button = scripting.addModule("/ti/drivers/apps/Button"); +const Button1 = Button.addInstance(); +const Button2 = Button.addInstance(); +const LED = scripting.addModule("/ti/drivers/apps/LED"); +const LED1 = LED.addInstance(); +const LED2 = LED.addInstance(); +const thread = scripting.addModule("/ti/thread/thread"); + +/** + * Write custom configuration values to the imported modules. + */ +ble.maxConnNum = 1; +ble.numOfAdvSets = 1; +ble.lockProject = true; +ble.maxPDUSize = 255; +ble.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param1"; +ble.connUpdateParamsPeripheral.$name = "ti_ble5stack_general_ble_conn_update_params0"; +ble.connUpdateParamsPeripheral.reqMinConnInt = 30; +ble.connUpdateParamsPeripheral.reqMaxConnInt = 50; +ble.advSet1.$name = "ti_ble5stack_broadcaster_advertisement_set0"; +ble.advSet1.advParam1.$name = "ti_ble5stack_broadcaster_advertisement_params0"; +ble.advSet1.advParam1.primIntMax = 200; +ble.advSet1.advData1.$name = "ti_ble5stack_broadcaster_advertisement_data0"; +ble.advSet1.scanRes1.$name = "ti_ble5stack_broadcaster_advertisement_data1"; + +CCFG.enableBootloader = true; +CCFG.enableBootloaderBackdoor = true; +CCFG.dioBootloaderBackdoor = 13; +CCFG.levelBootloaderBackdoor = "Active low"; +CCFG.srcClkLF = "Derived from HF XOSC"; +CCFG.ccfgTemplate.$name = "ti_devices_CCFGTemplate0"; + +dmm.project = "ti_thread_thermostat_remote_display"; +dmm.stackRoles = ["blePeripheral","threadFTD"]; +dmm.lockStackRoles = true; +dmm.numApplicationStates = 10; +dmm.applicationState0 = "ANY"; +dmm.applicationState1 = "DMMPOLICY_BLE_IDLE"; +dmm.applicationState2 = "DMMPOLICY_BLE_ADV"; +dmm.applicationState3 = "DMMPOLICY_BLE_CONNECTING"; +dmm.applicationState4 = "DMMPOLICY_BLE_HIGH_BANDWIDTH"; +dmm.applicationState5 = "DMMPOLICY_BLE_CONNECTED"; +dmm.applicationState6 = "DMMPOLICY_BLE_OAD"; +dmm.applicationState7 = "DMMPOLICY_THREAD_IDLE"; +dmm.applicationState8 = "DMMPOLICY_THREAD_LINK_EST"; +dmm.applicationState9 = "DMMPOLICY_THREAD_DATA"; +dmm.policyArray.create(4); +dmm.policyArray[0].$name = "ti_dmm_policy_dmm_policy0"; +dmm.policyArray[0].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble0"; +dmm.policyArray[0].blePeripheral.applicationStates = ["applicationState6"]; +dmm.policyArray[0].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread0"; +dmm.policyArray[0].threadFTD.pause = "DMMPOLICY_PAUSED"; +dmm.policyArray[1].$name = "ti_dmm_policy_dmm_policy1"; +dmm.policyArray[1].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble1"; +dmm.policyArray[1].blePeripheral.applicationStates = ["applicationState3","applicationState4"]; +dmm.policyArray[1].blePeripheral.weight = 25; +dmm.policyArray[1].blePeripheral.appliedActivity = ["DMMPOLICY_APPLIED_ACTIVITY_BLE_CONNECTION"]; +dmm.policyArray[1].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread1"; +dmm.policyArray[2].$name = "ti_dmm_policy_dmm_policy2"; +dmm.policyArray[2].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble2"; +dmm.policyArray[2].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread2"; +dmm.policyArray[2].threadFTD.weight = 30; +dmm.policyArray[2].threadFTD.applicationStates = ["applicationState8"]; +dmm.policyArray[2].threadFTD.appliedActivity = ["DMMPOLICY_APPLIED_ACTIVITY_ALL"]; +dmm.policyArray[3].$name = "ti_dmm_policy_dmm_policy3"; +dmm.policyArray[3].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble3"; +dmm.policyArray[3].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread3"; +dmm.policyArray[3].threadFTD.weight = 1; AESCCM1.$name = "CONFIG_AESCCM0"; + AESCCM2.$name = "CONFIG_AESCCM_1"; +AESCTRDRBG1.$name = "CONFIG_AESCTRDRBG_0"; +AESCTRDRBG1.aesctrObject.$name = "CONFIG_AESCTR_0"; + AESECB1.$name = "CONFIG_AESECB0"; + AESECB2.$name = "CONFIG_AESECB_1"; ECDH1.$name = "CONFIG_ECDH0"; + ECDH2.$name = "CONFIG_ECDH_1"; -/* RTOS */ -RTOS.name = "FreeRTOS"; +ECJPAKE1.$name = "CONFIG_ECJPAKE_0"; -/* Left Button */ -Button1.$name = "CONFIG_BTN_LEFT"; -Button1.$hardware = system.deviceData.board.components["BTN-1"]; -Button1.gpioPin.$name = "CONFIG_GPIO_BTN1"; -Button1.gpioPin.pull = "Pull Up"; -Button1.gpioPin.interruptTrigger = "Falling Edge"; -Button1.gpioPin.pinInstance.$name = "CONFIG_PIN_BTN1"; - -/* Left Button */ -Button2.$name = "CONFIG_BTN_RIGHT"; -Button2.$hardware = system.deviceData.board.components["BTN-2"]; -Button2.gpioPin.$name = "CONFIG_GPIO_BTN2"; -Button2.gpioPin.pull = "Pull Up"; -Button2.gpioPin.interruptTrigger = "Falling Edge"; -Button2.gpioPin.pinInstance.$name = "CONFIG_PIN_BTN2"; - -/* ======== CCFG ======== */ -var CCFG = scripting.addModule("/ti/devices/CCFG"); -const deviceName = system.getScript("/ti/ti154stack/ti154stack_common.js").getLaunchPadFromDevice(); -const ccfgSettings = system.getScript("/ti/common/lprf_ccfg_settings.js").ccfgSettings; -for(var setting in ccfgSettings) -{ - CCFG[setting] = ccfgSettings[setting]; -} - -// Update LF Clock Source for CC2652RB devices -if(deviceName.includes("RB")) -{ - CCFG.srcClkLF = "Derived from HF XOSC"; -} -/* NVS */ -NVS1.$name = "CONFIG_NVSINTERNAL"; +NVS1.$name = "CONFIG_NVSINTERNAL"; +NVS1.internalFlash.$name = "ti_drivers_nvs_NVSCC26XX0"; NVS1.internalFlash.regionBase = 0x78000; NVS1.internalFlash.regionSize = 0x4000; -/* RF */ -RF.$name = "CONFIG_RF0"; -/* if an antenna component exists, assign it to the rf instance */ -if (system.deviceData.board && system.deviceData.board.components.RF) { - RF.$hardware = system.deviceData.board.components.RF; -} - -const rfDesignSettings = system.getScript("/ti/common/lprf_rf_design_settings.js").rfDesignSettings; -for(var setting in rfDesignSettings) -{ - RFDesign[setting] = rfDesignSettings[setting]; -} - -/* Red LED */ -LED1.$name = "CONFIG_LED_RED"; -LED1.$hardware = system.deviceData.board.components.LED_RED; -LED1.gpioPin.$name = "CONFIG_GPIO_RLED"; -LED1.gpioPin.mode = "Output"; -LED1.gpioPin.callbackFunction = ""; -LED1.gpioPin.pinInstance.$name = "CONFIG_PIN_RLED"; - -/* Green LED */ -LED2.$name = "CONFIG_LED_GREEN"; -LED2.$hardware = system.deviceData.board.components.LED_GREEN; -LED2.gpioPin.$name = "CONFIG_GPIO_GLED"; -LED2.gpioPin.mode = "Output"; -LED2.gpioPin.callbackFunction = ""; -LED2.gpioPin.pinInstance.$name = "CONFIG_PIN_GLED"; - -/* Debug UART */ -UART1.$hardware = system.deviceData.board.components.XDS110UART; -UART1.$name = "CONFIG_UART_DEBUG"; - -/* Display UART */ -UART2.$name = "CONFIG_DISPLAY_UART"; -UART2.uart.txPin.$suggestSolution = "boosterpack.32"; -UART2.uart.rxPin.$suggestSolution = "boosterpack.18"; - -/* TRNG */ -TRNG1.$name = "CONFIG_TRNG_0"; -TRNG2.$name = "CONFIG_TRNG_1"; -TRNG3.$name = "CONFIG_TRNG_APP"; - -/* Thread */ -Thread.deviceType = "ftd"; -Thread.deviceTypeReadOnly = true; -/* Thread SysConfig generated sources are not used until the upstream modules - * can be updated to enable CHIP. - */ RTOS.name = "FreeRTOS"; -/* BLE */ -ble.addressMode = "ADDRMODE_RP_WITH_PUBLIC_ID"; -ble.maxConnNum = 1; -ble.numOfAdvSets = 1; -ble.lockProject = true; -ble.oneLibSizeOpt = true; -ble.maxPDUSize = 255; -ble.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param1"; -ble.connUpdateParamsPeripheral.$name = "ti_ble5stack_general_ble_conn_update_params0"; -ble.connUpdateParamsPeripheral.reqMinConnInt = 30; -ble.connUpdateParamsPeripheral.reqMaxConnInt = 50; - -ble.advSet1.$name = "ti_ble5stack_broadcaster_advertisement_set0"; -ble.advSet1.advParam1.$name = "ti_ble5stack_broadcaster_advertisement_params0"; -ble.advSet1.advParam1.primIntMin = 100; -ble.advSet1.advParam1.primIntMax = 200; - -/* DMM */ -dmm.project = "ti_thread_thermostat_remote_display"; -dmm.stackRoles = ["blePeripheral","threadFTD"]; -dmm.lockStackRoles = true; -dmm.numApplicationStates = 10; -dmm.applicationState0 = "ANY"; -dmm.applicationState1 = "DMMPOLICY_BLE_IDLE"; -dmm.applicationState2 = "DMMPOLICY_BLE_ADV"; -dmm.applicationState3 = "DMMPOLICY_BLE_CONNECTING"; -dmm.applicationState4 = "DMMPOLICY_BLE_HIGH_BANDWIDTH"; -dmm.applicationState5 = "DMMPOLICY_BLE_CONNECTED"; -dmm.applicationState6 = "DMMPOLICY_BLE_OAD"; -dmm.applicationState7 = "DMMPOLICY_THREAD_IDLE"; -dmm.applicationState8 = "DMMPOLICY_THREAD_LINK_EST"; -dmm.applicationState9 = "DMMPOLICY_THREAD_DATA"; -dmm.policyArray.create(4); -dmm.policyArray[0].$name = "ti_dmm_policy_dmm_policy0"; -dmm.policyArray[0].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble0"; -dmm.policyArray[0].blePeripheral.applicationStates = ["applicationState6"]; -dmm.policyArray[0].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread0"; -dmm.policyArray[0].threadFTD.pause = "DMMPOLICY_PAUSED"; -dmm.policyArray[1].$name = "ti_dmm_policy_dmm_policy1"; -dmm.policyArray[1].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble1"; -dmm.policyArray[1].blePeripheral.applicationStates = ["applicationState3","applicationState4"]; -dmm.policyArray[1].blePeripheral.weight = 25; -dmm.policyArray[1].blePeripheral.appliedActivity = ["DMMPOLICY_APPLIED_ACTIVITY_BLE_CONNECTION"]; -dmm.policyArray[1].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread1"; -dmm.policyArray[2].$name = "ti_dmm_policy_dmm_policy2"; -dmm.policyArray[2].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble2"; -dmm.policyArray[2].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread2"; -dmm.policyArray[2].threadFTD.weight = 30; -dmm.policyArray[2].threadFTD.applicationStates = ["applicationState8"]; -dmm.policyArray[2].threadFTD.appliedActivity = ["DMMPOLICY_APPLIED_ACTIVITY_ALL"]; -dmm.policyArray[3].$name = "ti_dmm_policy_dmm_policy3"; -dmm.policyArray[3].blePeripheral.$name = "ti_dmm_policy_stack_dmm_stack_ble3"; -dmm.policyArray[3].threadFTD.$name = "ti_dmm_policy_stack_dmm_stack_thread3"; -dmm.policyArray[3].threadFTD.weight = 1; +SHA21.$name = "CONFIG_SHA2_0"; + +TRNG1.$name = "CONFIG_TRNG_0"; + +TRNG2.$name = "CONFIG_TRNG_1"; + +TRNG3.$name = "CONFIG_TRNG_APP"; + +UART1.$name = "CONFIG_UART_DEBUG"; +UART1.uart.$assign = "UART1"; +UART1.uart.txPin.$assign = "boosterpack.4"; +UART1.uart.rxPin.$assign = "boosterpack.3"; +UART1.txPinInstance.$name = "CONFIG_PIN_4"; +UART1.rxPinInstance.$name = "CONFIG_PIN_5"; + +UART2.$name = "CONFIG_DISPLAY_UART"; +UART2.txPinInstance.$name = "CONFIG_PIN_6"; +UART2.rxPinInstance.$name = "CONFIG_PIN_7"; + +Button1.$name = "CONFIG_BTN_LEFT"; +Button1.gpioPin.$name = "CONFIG_GPIO_BTN1"; +Button1.gpioPin.gpioPin.$assign = "boosterpack.32"; +Button1.gpioPin.pinInstance.$name = "CONFIG_PIN_BTN1"; + +Button2.$name = "CONFIG_BTN_RIGHT"; +Button2.gpioPin.$name = "CONFIG_GPIO_BTN2"; +Button2.gpioPin.gpioPin.$assign = "boosterpack.13"; +Button2.gpioPin.pinInstance.$name = "CONFIG_PIN_BTN2"; + +LED1.$name = "CONFIG_LED_RED"; +LED1.gpioPin.$name = "CONFIG_GPIO_RLED"; +LED1.gpioPin.gpioPin.$assign = "boosterpack.10"; +LED1.gpioPin.pinInstance.$name = "CONFIG_PIN_RLED"; + +LED2.$name = "CONFIG_LED_GREEN"; +LED2.gpioPin.$name = "CONFIG_GPIO_GLED"; +LED2.gpioPin.gpioPin.$assign = "boosterpack.39"; +LED2.gpioPin.pinInstance.$name = "CONFIG_PIN_GLED"; + +thread.deviceTypeReadOnly = true; +thread.pm.$name = "ti_thread_pm_thread_pm0"; +thread.rf.$name = "ti_thread_rf_thread_rf0"; +thread.rf.radioConfig.$name = "ti_devices_radioconfig_settings_ieee_15_40"; +thread.rf.radioConfig.codeExportConfig.$name = "ti_devices_radioconfig_code_export_param0"; +thread.network.$name = "ti_thread_network_thread_network0"; +thread.security.$name = "ti_thread_security_thread_security0"; + +/** + * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future + * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to + * re-solve from scratch. + */ +UART2.uart.$suggestSolution = "UART0"; +UART2.uart.txPin.$suggestSolution = "boosterpack.30"; +UART2.uart.rxPin.$suggestSolution = "boosterpack.29"; diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp index dd2d3d63200f7f..fe0fcf339a695f 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp @@ -22,7 +22,16 @@ #include "AppEvent.h" #include +#include +#include +#include + #include "FreeRTOS.h" +#include +#include + +#include +#include #include #include @@ -30,11 +39,6 @@ #include -#include -#include - -//#include - #include #include @@ -84,7 +88,7 @@ int AppTask::StartAppTask() int AppTask::Init() { LED_Params ledParams; - Button_Params buttionParams; + Button_Params buttonParams; ConnectivityManager::ThreadPollingConfig pollingConfig; cc13x2_26x2LogInit(); @@ -167,18 +171,18 @@ int AppTask::Init() PLAT_LOG("Initialize buttons"); Button_init(); - Button_Params_init(&buttionParams); - buttionParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED; - buttionParams.longPressDuration = 1000U; // ms - sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, ButtonLeftEventHandler, &buttionParams); + Button_Params_init(&buttonParams); + buttonParams.buttonEventMask = Button_EV_CLICKED; + buttonParams.longPressDuration = 1000U; // ms + sAppLeftHandle = Button_open(CONFIG_BTN_LEFT, ButtonLeftEventHandler, &buttonParams); - Button_Params_init(&buttionParams); - buttionParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGCLICKED; - buttionParams.longPressDuration = 1000U; // ms - sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, ButtonRightEventHandler, &buttionParams); + Button_Params_init(&buttonParams); + buttonParams.buttonEventMask = Button_EV_CLICKED | Button_EV_LONGPRESSED; + buttonParams.longPressDuration = 5000U; // ms + sAppRightHandle = Button_open(CONFIG_BTN_RIGHT, ButtonRightEventHandler, &buttonParams); - // Initialize BoltLock module - PLAT_LOG("Initialize BoltLock"); + // Initialize Pump module + PLAT_LOG("Initialize Pump"); PumpMgr().Init(); PumpMgr().SetCallbacks(ActionInitiated, ActionCompleted); @@ -224,10 +228,7 @@ void AppTask::ButtonLeftEventHandler(Button_Handle handle, Button_EventMask even { event.ButtonEvent.Type = AppEvent::kAppEventButtonType_Clicked; } - else if (events & Button_EV_LONGCLICKED) - { - event.ButtonEvent.Type = AppEvent::kAppEventButtonType_LongClicked; - } + // button callbacks are in ISR context if (xQueueSendFromISR(sAppEventQueue, &event, NULL) != pdPASS) { @@ -244,9 +245,9 @@ void AppTask::ButtonRightEventHandler(Button_Handle handle, Button_EventMask eve { event.ButtonEvent.Type = AppEvent::kAppEventButtonType_Clicked; } - else if (events & Button_EV_LONGCLICKED) + else if (events & Button_EV_LONGPRESSED) { - event.ButtonEvent.Type = AppEvent::kAppEventButtonType_LongClicked; + event.ButtonEvent.Type = AppEvent::kAppEventButtonType_LongPressed; } // button callbacks are in ISR context if (xQueueSendFromISR(sAppEventQueue, &event, NULL) != pdPASS) @@ -257,16 +258,16 @@ void AppTask::ButtonRightEventHandler(Button_Handle handle, Button_EventMask eve void AppTask::ActionInitiated(PumpManager::Action_t aAction, int32_t aActor) { - // If the action has been initiated by the lock, update the bolt lock trait + // If the action has been initiated by the pump, update the pump trait // and start flashing the LEDs rapidly to indicate action initiation. - if (aAction == PumpManager::LOCK_ACTION) + if (aAction == PumpManager::START_ACTION) { - PLAT_LOG("Lock initiated"); + PLAT_LOG("Pump start initiated"); ; // TODO } - else if (aAction == PumpManager::UNLOCK_ACTION) + else if (aAction == PumpManager::STOP_ACTION) { - PLAT_LOG("Unlock initiated"); + PLAT_LOG("Stop initiated"); ; // TODO } @@ -278,20 +279,20 @@ void AppTask::ActionInitiated(PumpManager::Action_t aAction, int32_t aActor) void AppTask::ActionCompleted(PumpManager::Action_t aAction) { - // if the action has been completed by the lock, update the bolt lock trait. - // Turn on the lock LED if in a LOCKED state OR - // Turn off the lock LED if in an UNLOCKED state. - if (aAction == PumpManager::LOCK_ACTION) + // if the action has been completed by the pump, update the pump trait. + // Turn on the pump state LED if in a STARTED state OR + // Turn off the pump state LED if in an STOPPED state. + if (aAction == PumpManager::START_ACTION) { - PLAT_LOG("Lock completed"); + PLAT_LOG("Pump start completed"); LED_stopBlinking(sAppGreenHandle); LED_setOn(sAppGreenHandle, LED_BRIGHTNESS_MAX); LED_stopBlinking(sAppRedHandle); LED_setOn(sAppRedHandle, LED_BRIGHTNESS_MAX); } - else if (aAction == PumpManager::UNLOCK_ACTION) + else if (aAction == PumpManager::STOP_ACTION) { - PLAT_LOG("Unlock completed"); + PLAT_LOG("Pump stop completed"); LED_stopBlinking(sAppGreenHandle); LED_setOff(sAppGreenHandle); LED_stopBlinking(sAppRedHandle); @@ -306,18 +307,14 @@ void AppTask::DispatchEvent(AppEvent * aEvent) case AppEvent::kEventType_ButtonLeft: if (AppEvent::kAppEventButtonType_Clicked == aEvent->ButtonEvent.Type) { - if (!PumpMgr().IsUnlocked()) + // Toggle Pump state + if (!PumpMgr().IsStopped()) { - PumpMgr().InitiateAction(0, PumpManager::UNLOCK_ACTION); + PumpMgr().InitiateAction(0, PumpManager::STOP_ACTION); } - } - else if (AppEvent::kAppEventButtonType_LongClicked == aEvent->ButtonEvent.Type) - { - // Disable BLE advertisements - if (ConnectivityMgr().IsBLEAdvertisingEnabled()) + else { - ConnectivityMgr().SetBLEAdvertisingEnabled(false); - PLAT_LOG("Disabled BLE Advertisements"); + PumpMgr().InitiateAction(0, PumpManager::START_ACTION); } } break; @@ -325,14 +322,7 @@ void AppTask::DispatchEvent(AppEvent * aEvent) case AppEvent::kEventType_ButtonRight: if (AppEvent::kAppEventButtonType_Clicked == aEvent->ButtonEvent.Type) { - if (PumpMgr().IsUnlocked()) - { - PumpMgr().InitiateAction(0, PumpManager::LOCK_ACTION); - } - } - else if (AppEvent::kAppEventButtonType_LongClicked == aEvent->ButtonEvent.Type) - { - // Enable BLE advertisements + // Toggle BLE advertisements if (!ConnectivityMgr().IsBLEAdvertisingEnabled()) { if (chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() == CHIP_NO_ERROR) @@ -344,6 +334,16 @@ void AppTask::DispatchEvent(AppEvent * aEvent) PLAT_LOG("OpenBasicCommissioningWindow() failed"); } } + else + { + // Disable BLE advertisements + ConnectivityMgr().SetBLEAdvertisingEnabled(false); + PLAT_LOG("Disabled BLE Advertisements"); + } + } + else if (AppEvent::kAppEventButtonType_LongPressed == aEvent->ButtonEvent.Type) + { + ConfigurationMgr().InitiateFactoryReset(); } break; @@ -359,3 +359,5 @@ void AppTask::DispatchEvent(AppEvent * aEvent) break; } } + +void AppTask::UpdateClusterState() {} diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/PumpManager.cpp b/examples/pump-controller-app/cc13x2x7_26x2x7/main/PumpManager.cpp index 7869171d77f1f0..6d5020f3e89f10 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/PumpManager.cpp +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/PumpManager.cpp @@ -25,7 +25,7 @@ #define ACTUATOR_MOVEMENT_PERIOS_MS 500 -PumpManager PumpManager::sLock; +PumpManager PumpManager::sPump; int PumpManager::Init() { @@ -34,15 +34,15 @@ int PumpManager::Init() mTimerHandle = xTimerCreate("BLT_TIMER", pdMS_TO_TICKS(ACTUATOR_MOVEMENT_PERIOS_MS), pdFALSE, this, TimerEventHandler); if (NULL == mTimerHandle) { - PLAT_LOG("failed to create bolt lock timer"); + PLAT_LOG("failed to create pump timer"); while (1) ; } - mState = kState_LockingCompleted; - mAutoLockTimerArmed = false; - mAutoRelock = false; - mAutoLockDuration = 0; + mState = kState_StopCompleted; + mAutoStartTimerArmed = false; + mAutoRestart = false; + mAutoStartDuration = 0; return ret; } @@ -55,22 +55,22 @@ void PumpManager::SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callba bool PumpManager::IsActionInProgress() { - return (mState == kState_LockingInitiated || mState == kState_UnlockingInitiated); + return (mState == kState_StartInitiated || mState == kState_StopInitiated); } -bool PumpManager::IsUnlocked() +bool PumpManager::IsStopped() { - return (mState == kState_UnlockingCompleted); + return (mState == kState_StopCompleted); } -void PumpManager::EnableAutoRelock(bool aOn) +void PumpManager::EnableAutoRestart(bool aOn) { - mAutoRelock = aOn; + mAutoRestart = aOn; } -void PumpManager::SetAutoLockDuration(uint32_t aDurationInSecs) +void PumpManager::SetAutoStartDuration(uint32_t aDurationInSecs) { - mAutoLockDuration = aDurationInSecs; + mAutoStartDuration = aDurationInSecs; } bool PumpManager::InitiateAction(int32_t aActor, Action_t aAction) @@ -78,32 +78,32 @@ bool PumpManager::InitiateAction(int32_t aActor, Action_t aAction) bool action_initiated = false; State_t new_state; - // Initiate Lock/Unlock Action only when the previous one is complete. - if (mState == kState_LockingCompleted && aAction == UNLOCK_ACTION) + // Initiate Start/Stop Action only when the previous one is complete. + if (mState == kState_StartCompleted && aAction == STOP_ACTION) { action_initiated = true; - new_state = kState_UnlockingInitiated; + new_state = kState_StopInitiated; } - else if (mState == kState_UnlockingCompleted && aAction == LOCK_ACTION) + else if (mState == kState_StopCompleted && aAction == START_ACTION) { action_initiated = true; - new_state = kState_LockingInitiated; + new_state = kState_StartInitiated; } if (action_initiated) { - if (mAutoLockTimerArmed && new_state == kState_LockingInitiated) + if (mAutoStartTimerArmed && new_state == kState_StartInitiated) { - // If auto lock timer has been armed and someone initiates locking, + // If auto start timer has been armed and someone initiates start, // cancel the timer and continue as normal. - mAutoLockTimerArmed = false; + mAutoStartTimerArmed = false; CancelTimer(); } - StartTimer(ACTUATOR_MOVEMENT_PERIOS_MS); + PumpTimer(ACTUATOR_MOVEMENT_PERIOS_MS); // Since the timer started successfully, update the state and trigger callback mState = new_state; @@ -117,7 +117,7 @@ bool PumpManager::InitiateAction(int32_t aActor, Action_t aAction) return action_initiated; } -void PumpManager::StartTimer(uint32_t aTimeoutMs) +void PumpManager::PumpTimer(uint32_t aTimeoutMs) { xTimerChangePeriod(mTimerHandle, pdMS_TO_TICKS(aTimeoutMs), 100); xTimerStart(mTimerHandle, 100); @@ -130,17 +130,17 @@ void PumpManager::CancelTimer(void) void PumpManager::TimerEventHandler(TimerHandle_t aTimer) { - PumpManager * lock = static_cast(pvTimerGetTimerID(aTimer)); + PumpManager * pump = static_cast(pvTimerGetTimerID(aTimer)); // The timer event handler will be called in the context of the timer task - // once sLockTimer expires. Post an event to apptask queue with the actual handler + // once sPumpTimer expires. Post an event to apptask queue with the actual handler // so that the event can be handled in the context of the apptask. AppEvent event; - event.Type = AppEvent::kEventType_AppEvent; - event.BoltLockEvent.Context = static_cast(lock); - if (lock->mAutoLockTimerArmed) + event.Type = AppEvent::kEventType_AppEvent; + event.PumpStateEvent.Context = static_cast(pump); + if (pump->mAutoStartTimerArmed) { - event.Handler = AutoReLockTimerEventHandler; + event.Handler = AutoRestartTimerEventHandler; } else { @@ -149,56 +149,56 @@ void PumpManager::TimerEventHandler(TimerHandle_t aTimer) GetAppTask().PostEvent(&event); } -void PumpManager::AutoReLockTimerEventHandler(AppEvent * aEvent) +void PumpManager::AutoRestartTimerEventHandler(AppEvent * aEvent) { - PumpManager * lock = static_cast(aEvent->BoltLockEvent.Context); + PumpManager * pump = static_cast(aEvent->PumpStateEvent.Context); int32_t actor = 0; - // Make sure auto lock timer is still armed. - if (!lock->mAutoLockTimerArmed) + // Make sure auto start timer is still armed. + if (!pump->mAutoStartTimerArmed) { return; } - lock->mAutoLockTimerArmed = false; + pump->mAutoStartTimerArmed = false; - PLAT_LOG("Auto Re-Lock has been triggered!"); + PLAT_LOG("Auto Re-Start has been triggered!"); - lock->InitiateAction(actor, LOCK_ACTION); + pump->InitiateAction(actor, START_ACTION); } void PumpManager::ActuatorMovementTimerEventHandler(AppEvent * aEvent) { Action_t actionCompleted = INVALID_ACTION; - PumpManager * lock = static_cast(aEvent->BoltLockEvent.Context); + PumpManager * pump = static_cast(aEvent->PumpStateEvent.Context); - if (lock->mState == kState_LockingInitiated) + if (pump->mState == kState_StartInitiated) { - lock->mState = kState_LockingCompleted; - actionCompleted = LOCK_ACTION; + pump->mState = kState_StartCompleted; + actionCompleted = START_ACTION; } - else if (lock->mState == kState_UnlockingInitiated) + else if (pump->mState == kState_StopInitiated) { - lock->mState = kState_UnlockingCompleted; - actionCompleted = UNLOCK_ACTION; + pump->mState = kState_StopCompleted; + actionCompleted = STOP_ACTION; } if (actionCompleted != INVALID_ACTION) { - if (lock->mActionCompleted_CB) + if (pump->mActionCompleted_CB) { - lock->mActionCompleted_CB(actionCompleted); + pump->mActionCompleted_CB(actionCompleted); } - if (lock->mAutoRelock && actionCompleted == UNLOCK_ACTION) + if (pump->mAutoRestart && actionCompleted == STOP_ACTION) { - // Start the timer for auto relock - lock->StartTimer(lock->mAutoLockDuration * 1000); + // Start the timer for auto restart + pump->PumpTimer(pump->mAutoStartDuration * 1000); - lock->mAutoLockTimerArmed = true; + pump->mAutoStartTimerArmed = true; - PLAT_LOG("Auto Re-lock enabled. Will be triggered in %u seconds", lock->mAutoLockDuration); + PLAT_LOG("Auto Re-start enabled. Will be triggered in %u seconds", pump->mAutoStartDuration); } } } diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp b/examples/pump-controller-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp index 8d4abc4858c4a1..2ca101ae79ece6 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp @@ -15,7 +15,10 @@ * limitations under the License. */ +#include + #include "AppConfig.h" +#include "AppTask.h" #include "PumpManager.h" #include @@ -31,7 +34,17 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & { if (attributePath.mClusterId == OnOff::Id && attributePath.mAttributeId == OnOff::Attributes::OnOff::Id) { - PumpMgr().InitiateAction(0, *value ? PumpManager::LOCK_ACTION : PumpManager::UNLOCK_ACTION); + PumpMgr().InitiateAction(0, *value ? PumpManager::START_ACTION : PumpManager::STOP_ACTION); + } + else if (attributePath.mClusterId == LevelControl::Id && + attributePath.mAttributeId == LevelControl::Attributes::CurrentLevel::Id) + { + ChipLogProgress(Zcl, "[pump-app] Cluster LevelControl: attribute CurrentLevel set to %" PRIu8, *value); + } + else + { + ChipLogProgress(Zcl, "Unknown attribute ID: " ChipLogFormatMEI, ChipLogValueMEI(attributePath.mAttributeId)); + return; } } @@ -52,5 +65,5 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & */ void emberAfOnOffClusterInitCallback(EndpointId endpoint) { - // TODO: implement any additional Cluster Server init actions + GetAppTask().UpdateClusterState(); } diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/AppEvent.h b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/AppEvent.h index ad9e93ee3ad1a5..14c9f045231e2a 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/AppEvent.h +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/AppEvent.h @@ -37,6 +37,7 @@ struct AppEvent kAppEventButtonType_None = 0, kAppEventButtonType_Clicked, kAppEventButtonType_LongClicked, + kAppEventButtonType_LongPressed, }; enum AppEventType Type; @@ -51,7 +52,7 @@ struct AppEvent struct { void * Context; - } BoltLockEvent; + } PumpStateEvent; }; EventHandler Handler; diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/AppTask.h b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/AppTask.h index 7c6345e1bd9c26..65fb71df49adc9 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/AppTask.h +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/AppTask.h @@ -37,15 +37,15 @@ class AppTask int StartAppTask(); static void AppTaskMain(void * pvParameter); - void PostLockActionRequest(int32_t aActor, PumpManager::Action_t aAction); + void PostStartActionRequest(int32_t aActor, PumpManager::Action_t aAction); void PostEvent(const AppEvent * event); + void UpdateClusterState(); private: friend AppTask & GetAppTask(void); int Init(); - // should this be done by BoltLock Manager? I don't want to unravel this spaghetti quite yet static void ActionInitiated(PumpManager::Action_t aAction, int32_t aActor); static void ActionCompleted(PumpManager::Action_t aAction); diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/BoltLockManager.h b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/BoltLockManager.h deleted file mode 100644 index 40fc4ffb338a67..00000000000000 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/BoltLockManager.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef LOCK_MANAGER_H -#define LOCK_MANAGER_H - -#include -#include - -#include "AppEvent.h" - -#include -#include - -class BoltLockManager -{ -public: - enum Action_t - { - LOCK_ACTION = 0, - UNLOCK_ACTION, - - INVALID_ACTION - } Action; - - enum State_t - { - kState_LockingInitiated = 0, - kState_LockingCompleted, - kState_UnlockingInitiated, - kState_UnlockingCompleted, - } State; - - int Init(); - bool IsUnlocked(); - void EnableAutoRelock(bool aOn); - void SetAutoLockDuration(uint32_t aDurationInSecs); - bool IsActionInProgress(); - bool InitiateAction(int32_t aActor, Action_t aAction); - - typedef void (*Callback_fn_initiated)(Action_t, int32_t aActor); - typedef void (*Callback_fn_completed)(Action_t); - void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB); - -private: - friend BoltLockManager & BoltLockMgr(void); - State_t mState; - - Callback_fn_initiated mActionInitiated_CB; - Callback_fn_completed mActionCompleted_CB; - - bool mAutoRelock; - uint32_t mAutoLockDuration; - bool mAutoLockTimerArmed; - TimerHandle_t mTimerHandle; - - void CancelTimer(void); - void StartTimer(uint32_t aTimeoutMs); - - static void TimerEventHandler(TimerHandle_t aTimer); - static void AutoReLockTimerEventHandler(AppEvent * aEvent); - static void ActuatorMovementTimerEventHandler(AppEvent * aEvent); - - static BoltLockManager sLock; -}; - -inline BoltLockManager & BoltLockMgr(void) -{ - return BoltLockManager::sLock; -} - -#endif // LOCK_MANAGER_H diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index c0330d33d649df..3fbfe92feda6d7 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -28,21 +28,13 @@ #ifndef CHIP_PROJECT_CONFIG_H #define CHIP_PROJECT_CONFIG_H -#if BUILD_RELEASE // release build - -// Security and Authentication enabled for release build. +// Security and Authentication always enabled #define CHIP_CONFIG_SECURITY_TEST_MODE 0 #define CHIP_CONFIG_REQUIRE_AUTH 1 -#else // development build +#if BUILD_RELEASE // release build -// Security and Authentication disabled for development build. -// For convenience, enable CHIP Security Test Mode and disable the requirement for -// authentication in various protocols. -// WARNING: These options make it possible to circumvent basic CHIP security functionality, -// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. -#define CHIP_CONFIG_SECURITY_TEST_MODE 1 -#define CHIP_CONFIG_REQUIRE_AUTH 0 +#else // development build /** * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/PumpManager.h b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/PumpManager.h index ec83d508f91c1e..62988216fec1fb 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/PumpManager.h +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/PumpManager.h @@ -16,8 +16,8 @@ * limitations under the License. */ -#ifndef LOCK_MANAGER_H -#define LOCK_MANAGER_H +#ifndef PUMP_MANAGER_H +#define PUMP_MANAGER_H #include #include @@ -32,27 +32,41 @@ class PumpManager public: enum Action_t { - LOCK_ACTION = 0, - UNLOCK_ACTION, + START_ACTION = 0, + STOP_ACTION, INVALID_ACTION } Action; enum State_t { - kState_LockingInitiated = 0, - kState_LockingCompleted, - kState_UnlockingInitiated, - kState_UnlockingCompleted, + kState_StartInitiated = 0, + kState_StartCompleted, + kState_StopInitiated, + kState_StopCompleted, } State; int Init(); - bool IsUnlocked(); - void EnableAutoRelock(bool aOn); - void SetAutoLockDuration(uint32_t aDurationInSecs); + bool IsStopped(); + void EnableAutoRestart(bool aOn); + void SetAutoStartDuration(uint32_t aDurationInSecs); bool IsActionInProgress(); bool InitiateAction(int32_t aActor, Action_t aAction); + int16_t GetMaxPressure(); + uint16_t GetMaxSpeed(); + uint16_t GetMaxFlow(); + int16_t GetMinConstPressure(); + int16_t GetMaxConstPressure(); + int16_t GetMinCompPressure(); + int16_t GetMaxCompPressure(); + uint16_t GetMinConstSpeed(); + uint16_t GetMaxConstSpeed(); + uint16_t GetMinConstFlow(); + uint16_t GetMaxConstFlow(); + int16_t GetMinConstTemp(); + int16_t GetMaxConstTemp(); + typedef void (*Callback_fn_initiated)(Action_t, int32_t aActor); typedef void (*Callback_fn_completed)(Action_t); void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB); @@ -64,24 +78,24 @@ class PumpManager Callback_fn_initiated mActionInitiated_CB; Callback_fn_completed mActionCompleted_CB; - bool mAutoRelock; - uint32_t mAutoLockDuration; - bool mAutoLockTimerArmed; + bool mAutoRestart; + uint32_t mAutoStartDuration; + bool mAutoStartTimerArmed; TimerHandle_t mTimerHandle; void CancelTimer(void); - void StartTimer(uint32_t aTimeoutMs); + void PumpTimer(uint32_t aTimeoutMs); static void TimerEventHandler(TimerHandle_t aTimer); - static void AutoReLockTimerEventHandler(AppEvent * aEvent); + static void AutoRestartTimerEventHandler(AppEvent * aEvent); static void ActuatorMovementTimerEventHandler(AppEvent * aEvent); - static PumpManager sLock; + static PumpManager sPump; }; inline PumpManager & PumpMgr(void) { - return PumpManager::sLock; + return PumpManager::sPump; } -#endif // LOCK_MANAGER_H +#endif // PUMP_MANAGER_H diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/main.cpp b/examples/pump-controller-app/cc13x2x7_26x2x7/main/main.cpp index 1ed5409a721cce..03a1b6badebe6f 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/main.cpp +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/main.cpp @@ -37,7 +37,7 @@ #include #include -#define TOTAL_ICALL_HEAP_SIZE (0xf000) +#define TOTAL_ICALL_HEAP_SIZE (0xC000) using namespace ::chip; using namespace ::chip::Inet; @@ -77,8 +77,8 @@ int main(void) SHA2_init(); - CHIP_ERROR ret = GetAppTask().StartAppTask(); - if (ret != CHIP_NO_ERROR) + int ret = GetAppTask().StartAppTask(); + if (ret != 0) { // can't log until the kernel is started // PLAT_LOG("GetAppTask().StartAppTask() failed"); diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap index 11c66aa6c3dbd3..b052002b8e7ae6 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap @@ -3624,7 +3624,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -3639,7 +3639,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -3654,7 +3654,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -3669,7 +3669,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -3736,7 +3736,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -3751,7 +3751,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -3766,7 +3766,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -3781,7 +3781,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -3796,7 +3796,7 @@ "reportableChange": 0 }, { - "name": "scaled value", + "name": "ScaledValue", "code": 16, "mfgCode": null, "side": "server", @@ -3811,7 +3811,7 @@ "reportableChange": 0 }, { - "name": "scaled tolerance", + "name": "ScaledTolerance", "code": 19, "mfgCode": null, "side": "server", @@ -3878,7 +3878,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -3893,7 +3893,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -3908,7 +3908,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -3923,7 +3923,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -5232,7 +5232,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -5247,7 +5247,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -5262,7 +5262,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -5277,7 +5277,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -5344,7 +5344,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -5359,7 +5359,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -5374,7 +5374,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -5389,7 +5389,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -5404,7 +5404,7 @@ "reportableChange": 0 }, { - "name": "scaled value", + "name": "ScaledValue", "code": 16, "mfgCode": null, "side": "server", @@ -5419,7 +5419,7 @@ "reportableChange": 0 }, { - "name": "scaled tolerance", + "name": "ScaledTolerance", "code": 19, "mfgCode": null, "side": "server", @@ -5486,7 +5486,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -5501,7 +5501,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -5516,7 +5516,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -5531,7 +5531,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -5584,6 +5584,5 @@ "endpointVersion": 1, "deviceIdentifier": null } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/shell/shell_common/cmd_ping.cpp b/examples/shell/shell_common/cmd_ping.cpp index f4a44af7390163..2615c615cc3d07 100644 --- a/examples/shell/shell_common/cmd_ping.cpp +++ b/examples/shell/shell_common/cmd_ping.cpp @@ -144,7 +144,7 @@ Transport::PeerAddress GetEchoPeerAddress() #endif { - return Transport::PeerAddress::UDP(gDestAddr, gPingArguments.GetEchoPort(), INET_NULL_INTERFACEID); + return Transport::PeerAddress::UDP(gDestAddr, gPingArguments.GetEchoPort(), ::chip::Inet::InterfaceId::Null()); } } diff --git a/examples/shell/shell_common/cmd_send.cpp b/examples/shell/shell_common/cmd_send.cpp index 4e79ab38115482..99b7bc12c7a863 100644 --- a/examples/shell/shell_common/cmd_send.cpp +++ b/examples/shell/shell_common/cmd_send.cpp @@ -232,7 +232,7 @@ void ProcessCommand(streamer_t * stream, char * destination) else #endif { - peerAddress = Transport::PeerAddress::UDP(gDestAddr, gSendArguments.GetPort(), INET_NULL_INTERFACEID); + peerAddress = Transport::PeerAddress::UDP(gDestAddr, gSendArguments.GetPort(), Inet::InterfaceId::Null()); err = gSessionManager.Init(&DeviceLayer::SystemLayer(), &gUDPManager, &gMessageCounterManager); SuccessOrExit(err); diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap b/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap index f66335b283db4e..5d0531815c9861 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap @@ -2909,7 +2909,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -2924,7 +2924,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -2939,7 +2939,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -2954,7 +2954,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -3007,6 +3007,5 @@ "endpointVersion": null, "deviceIdentifier": null } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index e6796f6cf952e4..0d3b2e3e436ba6 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -5431,7 +5431,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -5446,7 +5446,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -5461,7 +5461,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -5476,7 +5476,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -9860,7 +9860,7 @@ "commands": [], "attributes": [ { - "name": "max pressure", + "name": "MaxPressure", "code": 0, "mfgCode": null, "side": "server", @@ -9875,7 +9875,7 @@ "reportableChange": 0 }, { - "name": "max speed", + "name": "MaxSpeed", "code": 1, "mfgCode": null, "side": "server", @@ -9890,7 +9890,7 @@ "reportableChange": 0 }, { - "name": "max flow", + "name": "MaxFlow", "code": 2, "mfgCode": null, "side": "server", @@ -9905,7 +9905,7 @@ "reportableChange": 0 }, { - "name": "pump status", + "name": "PumpStatus", "code": 16, "mfgCode": null, "side": "server", @@ -9920,7 +9920,7 @@ "reportableChange": 0 }, { - "name": "effective operation mode", + "name": "EffectiveOperationMode", "code": 17, "mfgCode": null, "side": "server", @@ -9935,7 +9935,7 @@ "reportableChange": 0 }, { - "name": "effective control mode", + "name": "EffectiveControlMode", "code": 18, "mfgCode": null, "side": "server", @@ -9950,7 +9950,7 @@ "reportableChange": 0 }, { - "name": "capacity", + "name": "Capacity", "code": 19, "mfgCode": null, "side": "server", @@ -9965,7 +9965,7 @@ "reportableChange": 0 }, { - "name": "operation mode", + "name": "OperationMode", "code": 32, "mfgCode": null, "side": "server", @@ -10284,6 +10284,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "min setpoint dead band", + "code": 25, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x19", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "control sequence of operation", "code": 27, @@ -11342,7 +11357,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -11357,7 +11372,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -11372,7 +11387,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -11387,7 +11402,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -11454,7 +11469,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -11469,7 +11484,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -11484,7 +11499,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -11499,7 +11514,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -11514,7 +11529,7 @@ "reportableChange": 0 }, { - "name": "scaled value", + "name": "ScaledValue", "code": 16, "mfgCode": null, "side": "server", @@ -11529,7 +11544,7 @@ "reportableChange": 0 }, { - "name": "scaled tolerance", + "name": "ScaledTolerance", "code": 19, "mfgCode": null, "side": "server", @@ -11596,7 +11611,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -11611,7 +11626,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -11626,7 +11641,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -16522,7 +16537,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -16537,7 +16552,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -16552,7 +16567,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -16567,7 +16582,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -16879,6 +16894,5 @@ "endpointVersion": null, "deviceIdentifier": null } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 6dbb662d9c53ef..eca078b61f1e5b 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -5416,7 +5416,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -5431,7 +5431,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -5446,7 +5446,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -5461,7 +5461,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -9840,6 +9840,5 @@ "endpointVersion": 1, "deviceIdentifier": 36 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap index 33496340325d41..05186d9b9c7187 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap @@ -5416,7 +5416,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -5431,7 +5431,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -5446,7 +5446,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -5461,7 +5461,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -9860,7 +9860,7 @@ "commands": [], "attributes": [ { - "name": "max pressure", + "name": "MaxPressure", "code": 0, "mfgCode": null, "side": "server", @@ -9875,7 +9875,7 @@ "reportableChange": 0 }, { - "name": "max speed", + "name": "MaxSpeed", "code": 1, "mfgCode": null, "side": "server", @@ -9890,7 +9890,7 @@ "reportableChange": 0 }, { - "name": "max flow", + "name": "MaxFlow", "code": 2, "mfgCode": null, "side": "server", @@ -9905,7 +9905,7 @@ "reportableChange": 0 }, { - "name": "pump status", + "name": "PumpStatus", "code": 16, "mfgCode": null, "side": "server", @@ -9920,7 +9920,7 @@ "reportableChange": 0 }, { - "name": "effective operation mode", + "name": "EffectiveOperationMode", "code": 17, "mfgCode": null, "side": "server", @@ -9935,7 +9935,7 @@ "reportableChange": 0 }, { - "name": "effective control mode", + "name": "EffectiveControlMode", "code": 18, "mfgCode": null, "side": "server", @@ -9950,7 +9950,7 @@ "reportableChange": 0 }, { - "name": "capacity", + "name": "Capacity", "code": 19, "mfgCode": null, "side": "server", @@ -9965,7 +9965,7 @@ "reportableChange": 0 }, { - "name": "operation mode", + "name": "OperationMode", "code": 32, "mfgCode": null, "side": "server", @@ -11222,7 +11222,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -11237,7 +11237,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -11252,7 +11252,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -11267,7 +11267,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -11334,7 +11334,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -11349,7 +11349,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -11364,7 +11364,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -11379,7 +11379,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -11394,7 +11394,7 @@ "reportableChange": 0 }, { - "name": "scaled value", + "name": "ScaledValue", "code": 16, "mfgCode": null, "side": "server", @@ -11409,7 +11409,7 @@ "reportableChange": 0 }, { - "name": "scaled tolerance", + "name": "ScaledTolerance", "code": 19, "mfgCode": null, "side": "server", @@ -11476,7 +11476,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -11491,7 +11491,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -11506,7 +11506,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -16341,7 +16341,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -16356,7 +16356,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -16371,7 +16371,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -16386,7 +16386,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -16698,6 +16698,5 @@ "endpointVersion": null, "deviceIdentifier": null } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 4bc95179e43ddc..ce1d9c023f2f93 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -5693,6 +5693,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -6909,6 +6924,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -6957,6 +6987,5 @@ "endpointVersion": 1, "deviceIdentifier": 514 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index f0c1a9f6ad79a8..54021da23e3ce6 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -94,6 +94,8 @@ def Esp32Targets(): yield esp32_target.Extend('m5stack-all-clusters', board=Esp32Board.M5Stack, app=Esp32App.ALL_CLUSTERS) yield esp32_target.Extend('m5stack-all-clusters-ipv6only', board=Esp32Board.M5Stack, app=Esp32App.ALL_CLUSTERS, enable_ipv4=False) + yield esp32_target.Extend('m5stack-all-clusters-rpc', board=Esp32Board.M5Stack, app=Esp32App.ALL_CLUSTERS, enable_rpcs=True) + yield esp32_target.Extend('m5stack-all-clusters-rpc-ipv6only', board=Esp32Board.M5Stack, app=Esp32App.ALL_CLUSTERS, enable_rpcs=True, enable_ipv4=False) yield esp32_target.Extend('c3devkit-all-clusters', board=Esp32Board.C3DevKit, app=Esp32App.ALL_CLUSTERS) devkitc = esp32_target.Extend('devkitc', board=Esp32Board.DevKitC) @@ -133,6 +135,7 @@ def NrfTargets(): for target in targets: yield target.Extend('lock', app=NrfApp.LOCK) yield target.Extend('light', app=NrfApp.LIGHT) + yield target.Extend('light-rpc', app=NrfApp.LIGHT, enable_rpcs=True) yield target.Extend('shell', app=NrfApp.SHELL) yield target.Extend('pump', app=NrfApp.PUMP) yield target.Extend('pump-controller', app=NrfApp.PUMP_CONTROLLER) diff --git a/scripts/build/builders/esp32.py b/scripts/build/builders/esp32.py index 752523f2db5fa8..51dfbcf55874a5 100644 --- a/scripts/build/builders/esp32.py +++ b/scripts/build/builders/esp32.py @@ -100,8 +100,9 @@ def __init__(self, self.enable_ipv4 = enable_ipv4 def _IdfEnvExecute(self, cmd, title=None): + # Run activate.sh after export.sh to ensure using the chip environment. self._Execute( - ['bash', '-c', 'source $IDF_PATH/export.sh; %s' % cmd], + ['bash', '-c', 'source $IDF_PATH/export.sh; source scripts/activate.sh; %s' % cmd], title=title) @property diff --git a/scripts/build/testdata/all_targets_except_host.txt b/scripts/build/testdata/all_targets_except_host.txt index 41a2a8edcf0626..6839ccb241218c 100644 --- a/scripts/build/testdata/all_targets_except_host.txt +++ b/scripts/build/testdata/all_targets_except_host.txt @@ -18,13 +18,17 @@ esp32-devkitc-shell esp32-devkitc-temperature-measurement esp32-m5stack-all-clusters esp32-m5stack-all-clusters-ipv6only +esp32-m5stack-all-clusters-rpc +esp32-m5stack-all-clusters-rpc-ipv6only infineon-p6-lock nrf-nrf52840-light +nrf-nrf52840-light-rpc nrf-nrf52840-lock nrf-nrf52840-pump nrf-nrf52840-pump-controller nrf-nrf52840-shell nrf-nrf5340-light +nrf-nrf5340-light-rpc nrf-nrf5340-lock nrf-nrf5340-pump nrf-nrf5340-pump-controller diff --git a/scripts/build/testdata/build_all_except_host.txt b/scripts/build/testdata/build_all_except_host.txt index b2514c7562a03f..9c1e998aa8f8ab 100644 --- a/scripts/build/testdata/build_all_except_host.txt +++ b/scripts/build/testdata/build_all_except_host.txt @@ -95,7 +95,7 @@ cp examples/all-clusters-app/esp32/sdkconfig_c3devkit.defaults {out}/esp32-c3dev rm -f examples/all-clusters-app/esp32/sdkconfig -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-c3devkit-all-clusters/sdkconfig.defaults idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-c3devkit-all-clusters reconfigure' @@ -106,7 +106,7 @@ cp examples/all-clusters-app/esp32/sdkconfig.defaults {out}/esp32-devkitc-all-cl rm -f examples/all-clusters-app/esp32/sdkconfig -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-all-clusters/sdkconfig.defaults idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-devkitc-all-clusters reconfigure' @@ -119,7 +119,7 @@ rm -f examples/all-clusters-app/esp32/sdkconfig bash -c 'echo CONFIG_DISABLE_IPV4=y >>{out}/esp32-devkitc-all-clusters-ipv6only/sdkconfig.defaults' -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-all-clusters-ipv6only/sdkconfig.defaults idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-devkitc-all-clusters-ipv6only reconfigure' @@ -130,7 +130,7 @@ cp examples/bridge-app/esp32/sdkconfig.defaults {out}/esp32-devkitc-bridge/sdkco rm -f examples/bridge-app/esp32/sdkconfig -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-bridge/sdkconfig.defaults idf.py -C examples/bridge-app/esp32 -B {out}/esp32-devkitc-bridge reconfigure' @@ -141,7 +141,7 @@ cp examples/lock-app/esp32/sdkconfig.defaults {out}/esp32-devkitc-lock/sdkconfig rm -f examples/lock-app/esp32/sdkconfig -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-lock/sdkconfig.defaults idf.py -C examples/lock-app/esp32 -B {out}/esp32-devkitc-lock reconfigure' @@ -152,7 +152,7 @@ cp examples/shell/esp32/sdkconfig.defaults {out}/esp32-devkitc-shell/sdkconfig.d rm -f examples/shell/esp32/sdkconfig -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-shell/sdkconfig.defaults idf.py -C examples/shell/esp32 -B {out}/esp32-devkitc-shell reconfigure' @@ -163,7 +163,7 @@ cp examples/temperature-measurement-app/esp32/sdkconfig.defaults {out}/esp32-dev rm -f examples/temperature-measurement-app/esp32/sdkconfig -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-temperature-measurement/sdkconfig.defaults idf.py -C examples/temperature-measurement-app/esp32 -B {out}/esp32-devkitc-temperature-measurement reconfigure' @@ -174,7 +174,7 @@ cp examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults {out}/esp32-m5stac rm -f examples/all-clusters-app/esp32/sdkconfig -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-m5stack-all-clusters/sdkconfig.defaults idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-m5stack-all-clusters reconfigure' @@ -187,10 +187,34 @@ rm -f examples/all-clusters-app/esp32/sdkconfig bash -c 'echo CONFIG_DISABLE_IPV4=y >>{out}/esp32-m5stack-all-clusters-ipv6only/sdkconfig.defaults' -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-m5stack-all-clusters-ipv6only/sdkconfig.defaults idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-m5stack-all-clusters-ipv6only reconfigure' +# Generating esp32-m5stack-all-clusters-rpc +mkdir -p {out}/esp32-m5stack-all-clusters-rpc + +cp examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults {out}/esp32-m5stack-all-clusters-rpc/sdkconfig.defaults + +rm -f examples/all-clusters-app/esp32/sdkconfig + +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; +export SDKCONFIG_DEFAULTS={out}/esp32-m5stack-all-clusters-rpc/sdkconfig.defaults +idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-m5stack-all-clusters-rpc reconfigure' + +# Generating esp32-m5stack-all-clusters-rpc-ipv6only +mkdir -p {out}/esp32-m5stack-all-clusters-rpc-ipv6only + +cp examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults {out}/esp32-m5stack-all-clusters-rpc-ipv6only/sdkconfig.defaults + +rm -f examples/all-clusters-app/esp32/sdkconfig + +bash -c 'echo CONFIG_DISABLE_IPV4=y >>{out}/esp32-m5stack-all-clusters-rpc-ipv6only/sdkconfig.defaults' + +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; +export SDKCONFIG_DEFAULTS={out}/esp32-m5stack-all-clusters-rpc-ipv6only/sdkconfig.defaults +idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-m5stack-all-clusters-rpc-ipv6only reconfigure' + # Generating infineon-p6-lock gn gen --check --fail-on-unused-args --root={root}/examples/lock-app/p6 '--args=p6_board="CY8CKIT-062S2-43012"' {out}/infineon-p6-lock @@ -199,6 +223,11 @@ bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh"; export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR"; west build --cmake-only -d {out}/nrf-nrf52840-light -b nrf52840dk_nrf52840 {root}/examples/lighting-app/nrfconnect' +# Generating nrf-nrf52840-light-rpc +bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh"; +export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR"; +west build --cmake-only -d {out}/nrf-nrf52840-light-rpc -b nrf52840dk_nrf52840 {root}/examples/lighting-app/nrfconnect -- -DOVERLAY_CONFIG=rpc.overlay' + # Generating nrf-nrf52840-lock bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh"; export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR"; @@ -224,6 +253,11 @@ bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh"; export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR"; west build --cmake-only -d {out}/nrf-nrf5340-light -b nrf5340dk_nrf5340_cpuapp {root}/examples/lighting-app/nrfconnect' +# Generating nrf-nrf5340-light-rpc +bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh"; +export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR"; +west build --cmake-only -d {out}/nrf-nrf5340-light-rpc -b nrf5340dk_nrf5340_cpuapp {root}/examples/lighting-app/nrfconnect -- -DOVERLAY_CONFIG=rpc.overlay' + # Generating nrf-nrf5340-lock bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh"; export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR"; @@ -383,72 +417,89 @@ ninja -C {out}/efr32-brd4161a-window-covering rm -f examples/all-clusters-app/esp32/sdkconfig # Building esp32-c3devkit-all-clusters -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-c3devkit-all-clusters/sdkconfig.defaults idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-c3devkit-all-clusters build' rm -f examples/all-clusters-app/esp32/sdkconfig # Building esp32-devkitc-all-clusters -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-all-clusters/sdkconfig.defaults idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-devkitc-all-clusters build' rm -f examples/all-clusters-app/esp32/sdkconfig # Building esp32-devkitc-all-clusters-ipv6only -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-all-clusters-ipv6only/sdkconfig.defaults idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-devkitc-all-clusters-ipv6only build' rm -f examples/bridge-app/esp32/sdkconfig # Building esp32-devkitc-bridge -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-bridge/sdkconfig.defaults idf.py -C examples/bridge-app/esp32 -B {out}/esp32-devkitc-bridge build' rm -f examples/lock-app/esp32/sdkconfig # Building esp32-devkitc-lock -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-lock/sdkconfig.defaults idf.py -C examples/lock-app/esp32 -B {out}/esp32-devkitc-lock build' rm -f examples/shell/esp32/sdkconfig # Building esp32-devkitc-shell -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-shell/sdkconfig.defaults idf.py -C examples/shell/esp32 -B {out}/esp32-devkitc-shell build' rm -f examples/temperature-measurement-app/esp32/sdkconfig # Building esp32-devkitc-temperature-measurement -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-devkitc-temperature-measurement/sdkconfig.defaults idf.py -C examples/temperature-measurement-app/esp32 -B {out}/esp32-devkitc-temperature-measurement build' rm -f examples/all-clusters-app/esp32/sdkconfig # Building esp32-m5stack-all-clusters -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-m5stack-all-clusters/sdkconfig.defaults idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-m5stack-all-clusters build' rm -f examples/all-clusters-app/esp32/sdkconfig # Building esp32-m5stack-all-clusters-ipv6only -bash -c 'source $IDF_PATH/export.sh; +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; export SDKCONFIG_DEFAULTS={out}/esp32-m5stack-all-clusters-ipv6only/sdkconfig.defaults idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-m5stack-all-clusters-ipv6only build' +rm -f examples/all-clusters-app/esp32/sdkconfig + +# Building esp32-m5stack-all-clusters-rpc +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; +export SDKCONFIG_DEFAULTS={out}/esp32-m5stack-all-clusters-rpc/sdkconfig.defaults +idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-m5stack-all-clusters-rpc build' + +rm -f examples/all-clusters-app/esp32/sdkconfig + +# Building esp32-m5stack-all-clusters-rpc-ipv6only +bash -c 'source $IDF_PATH/export.sh; source scripts/activate.sh; +export SDKCONFIG_DEFAULTS={out}/esp32-m5stack-all-clusters-rpc-ipv6only/sdkconfig.defaults +idf.py -C examples/all-clusters-app/esp32 -B {out}/esp32-m5stack-all-clusters-rpc-ipv6only build' + # Building infineon-p6-lock ninja -C {out}/infineon-p6-lock # Building nrf-nrf52840-light ninja -C {out}/nrf-nrf52840-light +# Building nrf-nrf52840-light-rpc +ninja -C {out}/nrf-nrf52840-light-rpc + # Building nrf-nrf52840-lock ninja -C {out}/nrf-nrf52840-lock @@ -464,6 +515,9 @@ ninja -C {out}/nrf-nrf52840-shell # Building nrf-nrf5340-light ninja -C {out}/nrf-nrf5340-light +# Building nrf-nrf5340-light-rpc +ninja -C {out}/nrf-nrf5340-light-rpc + # Building nrf-nrf5340-lock ninja -C {out}/nrf-nrf5340-lock diff --git a/scripts/examples/gn_build_test_example.sh b/scripts/examples/gn_build_test_example.sh index a7954ec8a2f401..49c025b6ad854b 100755 --- a/scripts/examples/gn_build_test_example.sh +++ b/scripts/examples/gn_build_test_example.sh @@ -30,7 +30,7 @@ source "$CHIP_ROOT/scripts/activate.sh" APP_DIR=$1 function runZAP() { - ZAP_INPUT_FILE=$INPUT_DIR/apps/$APP_DIR/zap.config + ZAP_INPUT_FILE=$INPUT_DIR/apps/$APP_DIR/config.zap ZAP_OUTPUT_DIR=$OUTPUT_DIR/$APP_DIR/zap-generated # Create the folder to host the generated content if needed diff --git a/scripts/helpers/pull_upstream_and_regenerate_zap.sh b/scripts/helpers/pull_upstream_and_regenerate_zap.sh new file mode 100755 index 00000000000000..434f6c35bbf90a --- /dev/null +++ b/scripts/helpers/pull_upstream_and_regenerate_zap.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -x + +git pull upstream master +git submodule update --init --recursive third_party/zap/ + +git status + +cd third_party/zap/repo/ +npm ci +npm run version-stamp +npm rebuild canvas --update-binary +npm run build-spa + +cd ../../../ + +scripts/tools/zap_regen_all.py + +git status + +git add . + +git status + +git commit -m "Regenerating ZAP" diff --git a/scripts/helpers/rebase_and_regenerate_zap.sh b/scripts/helpers/rebase_and_regenerate_zap.sh deleted file mode 100755 index 7ba2f829366285..00000000000000 --- a/scripts/helpers/rebase_and_regenerate_zap.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash -# Credit to https://github.com/cirrus-actions/rebase for the base functionality here - -set -e - -PR_NUMBER=$(jq -r ".pull_request.number" "$GITHUB_EVENT_PATH") -if [[ "$PR_NUMBER" == "null" ]]; then - PR_NUMBER=$(jq -r ".issue.number" "$GITHUB_EVENT_PATH") -fi -if [[ "$PR_NUMBER" == "null" ]]; then - echo "Failed to determine PR Number." - exit 1 -fi -echo "Collecting information about PR #$PR_NUMBER of $GITHUB_REPOSITORY..." - -if [[ -z "$GITHUB_TOKEN" ]]; then - echo "Set the GITHUB_TOKEN env variable." - exit 1 -fi - -URI=https://api.github.com -API_HEADER="Accept: application/vnd.github.v3+json" -AUTH_HEADER="Authorization: token $GITHUB_TOKEN" - -pr_resp=$(curl -X GET -s -H "${AUTH_HEADER}" -H "${API_HEADER}" \ - "${URI}/repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER") - -BASE_REPO=$(echo "$pr_resp" | jq -r .base.repo.full_name) -BASE_BRANCH=$(echo "$pr_resp" | jq -r .base.ref) - -USER_LOGIN=$(jq -r ".comment.user.login" "$GITHUB_EVENT_PATH") - -user_resp=$(curl -X GET -s -H "${AUTH_HEADER}" -H "${API_HEADER}" \ - "${URI}/users/${USER_LOGIN}") - -USER_NAME=$(echo "$user_resp" | jq -r ".name") -if [[ "$USER_NAME" == "null" ]]; then - USER_NAME=$USER_LOGIN -fi -USER_NAME="${USER_NAME} (Rebase PR Action)" - -USER_EMAIL=$(echo "$user_resp" | jq -r ".email") -if [[ "$USER_EMAIL" == "null" ]]; then - USER_EMAIL="$USER_LOGIN@users.noreply.github.com" -fi - -if [[ -z "$BASE_BRANCH" ]]; then - echo "Cannot get base branch information for PR #$PR_NUMBER!" - exit 1 -fi - -HEAD_REPO=$(echo "$pr_resp" | jq -r .head.repo.full_name) -HEAD_BRANCH=$(echo "$pr_resp" | jq -r .head.ref) - -echo "Base branch for PR #$PR_NUMBER is $BASE_BRANCH" - -USER_TOKEN=${USER_LOGIN//-/_}_TOKEN -UNTRIMMED_COMMITTER_TOKEN=${!USER_TOKEN:-$GITHUB_TOKEN} -COMMITTER_TOKEN="$(echo -e "${UNTRIMMED_COMMITTER_TOKEN}" | tr -d '[:space:]')" - -git remote set-url origin https://x-access-token:$COMMITTER_TOKEN@github.com/$GITHUB_REPOSITORY.git -git config --global user.email "$USER_EMAIL" -git config --global user.name "$USER_NAME" - -git remote add fork https://x-access-token:$COMMITTER_TOKEN@github.com/$HEAD_REPO.git - -set -o xtrace - -# make sure branches are up-to-date -git fetch origin $BASE_BRANCH -git fetch fork $HEAD_BRANCH - -# do the rebase -git checkout -b $HEAD_BRANCH fork/$HEAD_BRANCH -git rebase origin/$BASE_BRANCH - -git submodule update --init --recursive third_party/zap/ - -cd third_party/zap/repo/ -npm ci -npm run version-stamp -npm rebuild canvas --update-binary -npm run build-spa - -cd ../../../ - -scripts/tools/zap_regen_all.py - -git status - -git add zzz_generated/* -git add src/darwin/Framework/* -git add src/controller/python/chip/clusters/* -git add src/controller/java/zap-generated/* - -git commit -m "Regenerating ZAP" - -# push back -git push --force-with-lease fork fork/"$HEAD_BRANCH:$HEAD_BRANCH" diff --git a/scripts/tools/zap_regen_all.py b/scripts/tools/zap_regen_all.py index 27e6b1c5a83d46..87b9900e89930f 100755 --- a/scripts/tools/zap_regen_all.py +++ b/scripts/tools/zap_regen_all.py @@ -40,6 +40,11 @@ def getGlobalTemplatesTargets(): example_name = example_name[example_name.index('examples/') + 9:] example_name = example_name[:example_name.index('/')] + # Ignore placeholder examples since the zap files there are not intended to + # be part of the tree. + if example_name == "placeholder": + continue + logging.info("Found example %s (via %s)" % (example_name, str(filepath))) diff --git a/src/android/CHIPTest/gradle.properties b/src/android/CHIPTest/gradle.properties index d5dcc9461e28f2..3026069c70e98f 100644 --- a/src/android/CHIPTest/gradle.properties +++ b/src/android/CHIPTest/gradle.properties @@ -21,10 +21,10 @@ kotlin.code.style=official # Build SDK from source code and debug in Android Stduio. Must also set matterBuildSrcDir. matterSdkSourceBuild=false -# Point to the SDK build dir without quotes (../../../../out/android-arm64-chip-test for +# Point to the SDK build dir without quotes (out/android-arm64-chip-test for # example) to build SDK from source code and debug in Android Studio. # Set to blank to use the SDK prebuilt by scripts/build/build_examples.py. -matterBuildSrcDir=../../../../out/android-arm64-chip-test +matterBuildSrcDir=out/android-arm64-chip-test # Test libs to run matterUTestLib=libPlatformTests.a diff --git a/src/app/clusters/basic/basic.cpp b/src/app/clusters/basic/basic.cpp index 6977ea2b52f73c..0747e43cf7cab1 100644 --- a/src/app/clusters/basic/basic.cpp +++ b/src/app/clusters/basic/basic.cpp @@ -18,81 +18,76 @@ #include "basic.h" +#include #include -#include -#include -#include -#include -#include -#include -#include -#include - #include using namespace chip; +using namespace chip::app::Clusters::Basic; using namespace chip::DeviceLayer; void emberAfBasicClusterServerInitCallback(chip::EndpointId endpoint) { - uint16_t vendorId; - uint16_t productId; - uint16_t productRevision; - uint32_t firmwareRevision; - char cString[65]; - uint8_t bufferMemory[65]; - MutableByteSpan zclString(bufferMemory); + EmberAfStatus status; - if (ConfigurationMgr().GetVendorName(cString, sizeof(cString)) == CHIP_NO_ERROR) + char vendorName[33]; + if (ConfigurationMgr().GetVendorName(vendorName, sizeof(vendorName)) == CHIP_NO_ERROR) { - MakeZclCharString(zclString, cString); - emberAfWriteAttribute(endpoint, ZCL_BASIC_CLUSTER_ID, ZCL_VENDOR_NAME_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, zclString.data(), - ZCL_CHAR_STRING_ATTRIBUTE_TYPE); + status = Attributes::VendorName::Set(endpoint, chip::CharSpan(vendorName, strlen(vendorName))); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Vendor Name: 0x%02x", status)); } + uint16_t vendorId; if (ConfigurationMgr().GetVendorId(vendorId) == CHIP_NO_ERROR) { - emberAfWriteAttribute(endpoint, ZCL_BASIC_CLUSTER_ID, ZCL_VENDOR_ID_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, - reinterpret_cast(&vendorId), ZCL_INT16U_ATTRIBUTE_TYPE); + status = Attributes::VendorID::Set(endpoint, vendorId); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Vendor Id: 0x%02x", status)); } - if (ConfigurationMgr().GetProductName(cString, sizeof(cString)) == CHIP_NO_ERROR) + char productName[33]; + if (ConfigurationMgr().GetProductName(productName, sizeof(productName)) == CHIP_NO_ERROR) { - MakeZclCharString(zclString, cString); - emberAfWriteAttribute(endpoint, ZCL_BASIC_CLUSTER_ID, ZCL_PRODUCT_NAME_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, zclString.data(), - ZCL_CHAR_STRING_ATTRIBUTE_TYPE); + status = Attributes::ProductName::Set(endpoint, chip::CharSpan(productName, strlen(productName))); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Product Name: 0x%02x", status)); } + uint16_t productId; if (ConfigurationMgr().GetProductId(productId) == CHIP_NO_ERROR) { - emberAfWriteAttribute(endpoint, ZCL_BASIC_CLUSTER_ID, ZCL_PRODUCT_ID_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, - reinterpret_cast(&productId), ZCL_INT16U_ATTRIBUTE_TYPE); + status = Attributes::ProductID::Set(endpoint, productId); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Product Id: 0x%02x", status)); } - if (ConfigurationMgr().GetProductRevisionString(cString, sizeof(cString)) == CHIP_NO_ERROR) + char productRevisionString[65]; + if (ConfigurationMgr().GetProductRevisionString(productRevisionString, sizeof(productRevisionString)) == CHIP_NO_ERROR) { - MakeZclCharString(zclString, cString); - emberAfWriteAttribute(endpoint, ZCL_BASIC_CLUSTER_ID, ZCL_HARDWARE_VERSION_STRING_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, - zclString.data(), ZCL_CHAR_STRING_ATTRIBUTE_TYPE); + status = + Attributes::HardwareVersionString::Set(endpoint, chip::CharSpan(productRevisionString, strlen(productRevisionString))); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(Zcl, "Error setting Hardware Version String: 0x%02x", status)); } + uint16_t productRevision; if (ConfigurationMgr().GetProductRevision(productRevision) == CHIP_NO_ERROR) { - emberAfWriteAttribute(endpoint, ZCL_BASIC_CLUSTER_ID, ZCL_HARDWARE_VERSION_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, - reinterpret_cast(&productRevision), ZCL_INT16U_ATTRIBUTE_TYPE); + status = Attributes::HardwareVersion::Set(endpoint, productRevision); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Hardware Version: 0x%02x", status)); } - if (ConfigurationMgr().GetFirmwareRevisionString(cString, sizeof(cString)) == CHIP_NO_ERROR) + char firmwareRevisionString[65]; + if (ConfigurationMgr().GetFirmwareRevisionString(firmwareRevisionString, sizeof(firmwareRevisionString)) == CHIP_NO_ERROR) { - MakeZclCharString(zclString, cString); - emberAfWriteAttribute(endpoint, ZCL_BASIC_CLUSTER_ID, ZCL_SOFTWARE_VERSION_STRING_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, - zclString.data(), ZCL_CHAR_STRING_ATTRIBUTE_TYPE); + status = Attributes::SoftwareVersionString::Set(endpoint, + chip::CharSpan(firmwareRevisionString, strlen(firmwareRevisionString))); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(Zcl, "Error setting Software Version String: 0x%02x", status)); } + uint16_t firmwareRevision; if (ConfigurationMgr().GetFirmwareRevision(firmwareRevision) == CHIP_NO_ERROR) { - emberAfWriteAttribute(endpoint, ZCL_BASIC_CLUSTER_ID, ZCL_SOFTWARE_VERSION_ATTRIBUTE_ID, CLUSTER_MASK_SERVER, - reinterpret_cast(&firmwareRevision), ZCL_INT32U_ATTRIBUTE_TYPE); + status = Attributes::HardwareVersion::Set(endpoint, firmwareRevision); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Software Version: 0x%02x", status)); } } diff --git a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp index 5e97fcf0da1c9b..ee0dd933d54498 100644 --- a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp +++ b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp @@ -32,6 +32,6 @@ void emberAfPumpConfigurationAndControlClusterServerInitCallback(EndpointId endp void MatterPumpConfigurationAndControlClusterServerAttributeChangedCallback(const app::ConcreteAttributePath & attributePath) { emberAfDebugPrintln("PCC Server Cluster Attribute changed [EP:%d, ID:0x%x]", attributePath.mEndpointId, - attributePath.mAttributeId); + (unsigned int) attributePath.mAttributeId); // TODO } diff --git a/src/app/clusters/test-cluster-server/test-cluster-server.cpp b/src/app/clusters/test-cluster-server/test-cluster-server.cpp index d971c1b49eac4f..adad9add1e7ac7 100644 --- a/src/app/clusters/test-cluster-server/test-cluster-server.cpp +++ b/src/app/clusters/test-cluster-server/test-cluster-server.cpp @@ -430,6 +430,30 @@ bool emberAfTestClusterClusterTestEnumsRequestCallback(CommandHandler * commandO return true; } +bool emberAfTestClusterClusterTestNullableOptionalRequestCallback( + CommandHandler * commandObj, ConcreteCommandPath const & commandPath, + Commands::TestNullableOptionalRequest::DecodableType const & commandData) +{ + Commands::TestNullableOptionalResponse::Type response; + response.wasPresent = commandData.arg1.HasValue(); + if (response.wasPresent) + { + bool wasNull = commandData.arg1.Value().IsNull(); + response.wasNull.SetValue(wasNull); + if (!wasNull) + { + response.value.SetValue(commandData.arg1.Value().Value()); + } + } + + CHIP_ERROR err = commandObj->AddResponseData(commandPath, response); + if (err != CHIP_NO_ERROR) + { + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_FAILURE); + } + return true; +} + // ----------------------------------------------------------------------------- // Plugin initialization diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp index ce1d1b7d55a65d..214bbda4f5f206 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -51,6 +51,23 @@ constexpr int16_t kDefaultHeatingSetpoint = 2000; constexpr int16_t kDefaultCoolingSetpoint = 2600; constexpr uint8_t kInvalidControlSequenceOfOperation = 0xff; constexpr uint8_t kInvalidRequestedSystemMode = 0xff; +constexpr int8_t kDefaultDeadBand = 25; // 2.5C is the default + +// IMPORTANT NOTE: +// No Side effects are permitted in emberAfThermostatClusterServerPreAttributeChangedCallback +// If a setpoint changes is required as a result of setpoint limit change +// it does not happen here. It is the responsibility of the device to adjust the setpoint(s) +// as required in emberAfThermostatClusterServerPostAttributeChangedCallback +// limit change validation assures that there is at least 1 setpoint that will be valid + +#define FEATURE_MAP_HEAT 0x01 +#define FEATURE_MAP_COOL 0x02 +#define FEATURE_MAP_OCC 0x04 +#define FEATURE_MAP_SCH 0x08 +#define FEATURE_MAP_SB 0x10 +#define FEATURE_MAP_AUTO 0x20 + +#define FEATURE_MAP_OVERIDE FEATURE_MAP_HEAT | FEATURE_MAP_COOL | FEATURE_MAP_AUTO void emberAfThermostatClusterServerInitCallback() { @@ -68,155 +85,243 @@ void emberAfThermostatClusterServerInitCallback() // or should this just be the responsibility of the thermostat application? } +using imcode = Protocols::InteractionModel::Status; + Protocols::InteractionModel::Status MatterThermostatClusterServerPreAttributeChangedCallback(const app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value) { - EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; - EndpointId endpoint = attributePath.mEndpointId; + EndpointId endpoint = attributePath.mEndpointId; int16_t requested; - switch (attributePath.mAttributeId) + // Limits will be needed for all checks + // so we just get them all now + int16_t AbsMinHeatSetpointLimit; + int16_t AbsMaxHeatSetpointLimit; + int16_t MinHeatSetpointLimit; + int16_t MaxHeatSetpointLimit; + int16_t AbsMinCoolSetpointLimit; + int16_t AbsMaxCoolSetpointLimit; + int16_t MinCoolSetpointLimit; + int16_t MaxCoolSetpointLimit; + int8_t DeadBand = 0; + int16_t DeadBandTemp = 0; + uint32_t FeatureMap = 0; + bool AutoSupported = false; + bool HeatSupported = false; + bool CoolSupported = false; + bool OccupancySupported = false; + int16_t OccupiedCoolingSetpoint; + int16_t OccupiedHeatingSetpoint; + int16_t UnoccupiedCoolingSetpoint; + int16_t UnoccupiedHeatingSetpoint; + +// TODO re-enable reading reaturemap once https://github.com/project-chip/connectedhomeip/pull/9725 is merged +#ifndef FEATURE_MAP_OVERIDE + emberAfReadServerAttribute(endpoint, Thermostat::Id, chip::app::Clusters::Globals::Attributes::Ids::FeatureMap, + (uint8_t *) &FeatureMap, sizeof(FeatureMap)); +#else + FeatureMap = FEATURE_MAP_OVERIDE; +#endif + + if (FeatureMap & 1 << 5) // Bit 5 is Auto Mode supported { - case OccupiedHeatingSetpoint::Id: { - int16_t AbsMinHeatSetpointLimit; - int16_t AbsMaxHeatSetpointLimit; - int16_t MinHeatSetpointLimit; - int16_t MaxHeatSetpointLimit; + AutoSupported = true; + if (MinSetpointDeadBand::Get(endpoint, &DeadBand) != EMBER_ZCL_STATUS_SUCCESS) + { + DeadBand = kDefaultDeadBand; + } + DeadBandTemp = static_cast(DeadBand * 10); + } + if (FeatureMap & 1 << 0) + HeatSupported = true; + + if (FeatureMap & 1 << 1) + CoolSupported = true; + + if (FeatureMap & 1 << 2) + OccupancySupported = true; + + if (AbsMinCoolSetpointLimit::Get(endpoint, &AbsMinCoolSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS) + AbsMinCoolSetpointLimit = kDefaultAbsMinCoolSetpointLimit; - status = AbsMinHeatSetpointLimit::Get(endpoint, &AbsMinHeatSetpointLimit); - if (status != EMBER_ZCL_STATUS_SUCCESS) + if (AbsMaxCoolSetpointLimit::Get(endpoint, &AbsMaxCoolSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS) + AbsMaxCoolSetpointLimit = kDefaultAbsMaxCoolSetpointLimit; + + if (MinCoolSetpointLimit::Get(endpoint, &MinCoolSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS) + MinCoolSetpointLimit = AbsMinCoolSetpointLimit; + + if (MaxCoolSetpointLimit::Get(endpoint, &MaxCoolSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS) + MaxCoolSetpointLimit = AbsMaxCoolSetpointLimit; + + if (AbsMinHeatSetpointLimit::Get(endpoint, &AbsMinHeatSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS) + AbsMinHeatSetpointLimit = kDefaultAbsMinHeatSetpointLimit; + + if (AbsMaxHeatSetpointLimit::Get(endpoint, &AbsMaxHeatSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS) + AbsMaxHeatSetpointLimit = kDefaultAbsMaxHeatSetpointLimit; + + if (MinHeatSetpointLimit::Get(endpoint, &MinHeatSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS) + MinHeatSetpointLimit = AbsMinHeatSetpointLimit; + + if (MaxHeatSetpointLimit::Get(endpoint, &MaxHeatSetpointLimit) != EMBER_ZCL_STATUS_SUCCESS) + MaxHeatSetpointLimit = AbsMaxHeatSetpointLimit; + + if (CoolSupported) + if (OccupiedCoolingSetpoint::Get(endpoint, &OccupiedCoolingSetpoint) != EMBER_ZCL_STATUS_SUCCESS) { - AbsMinHeatSetpointLimit = kDefaultAbsMinHeatSetpointLimit; + ChipLogError(Zcl, "Error: Can not read Occupied Cooling Setpoint"); + return imcode::Failure; } - status = AbsMaxHeatSetpointLimit::Get(endpoint, &AbsMaxHeatSetpointLimit); - if (status != EMBER_ZCL_STATUS_SUCCESS) + if (HeatSupported) + if (OccupiedHeatingSetpoint::Get(endpoint, &OccupiedHeatingSetpoint) != EMBER_ZCL_STATUS_SUCCESS) { - AbsMaxHeatSetpointLimit = kDefaultAbsMaxHeatSetpointLimit; + ChipLogError(Zcl, "Error: Can not read Occupied Heating Setpoint"); + return imcode::Failure; } - status = MinHeatSetpointLimit::Get(endpoint, &MinHeatSetpointLimit); - if (status != EMBER_ZCL_STATUS_SUCCESS) + if (CoolSupported && OccupancySupported) + if (UnoccupiedCoolingSetpoint::Get(endpoint, &UnoccupiedCoolingSetpoint) != EMBER_ZCL_STATUS_SUCCESS) { - MinHeatSetpointLimit = AbsMinHeatSetpointLimit; + ChipLogError(Zcl, "Error: Can not read Unoccupied Cooling Setpoint"); + return imcode::Failure; } - status = MaxHeatSetpointLimit::Get(endpoint, &MaxHeatSetpointLimit); - if (status != EMBER_ZCL_STATUS_SUCCESS) + if (HeatSupported && OccupancySupported) + if (UnoccupiedHeatingSetpoint::Get(endpoint, &UnoccupiedHeatingSetpoint) != EMBER_ZCL_STATUS_SUCCESS) { - MaxHeatSetpointLimit = AbsMaxHeatSetpointLimit; + ChipLogError(Zcl, "Error: Can not read Unoccupied Heating Setpoint"); + return imcode::Failure; } + switch (attributePath.mAttributeId) + { + case OccupiedHeatingSetpoint::Id: { requested = static_cast(chip::Encoding::LittleEndian::Get16(value)); - if (requested < AbsMinHeatSetpointLimit || requested < MinHeatSetpointLimit || requested > AbsMaxHeatSetpointLimit || - requested > MaxHeatSetpointLimit) - status = EMBER_ZCL_STATUS_INVALID_VALUE; - else - status = EMBER_ZCL_STATUS_SUCCESS; - - break; + if (!HeatSupported) + return imcode::UnsupportedAttribute; + else if (requested < AbsMinHeatSetpointLimit || requested < MinHeatSetpointLimit || requested > AbsMaxHeatSetpointLimit || + requested > MaxHeatSetpointLimit) + return imcode::InvalidValue; + else if (AutoSupported) + { + if (requested > OccupiedCoolingSetpoint - DeadBandTemp) + return imcode::InvalidValue; + } + return imcode::Success; } case OccupiedCoolingSetpoint::Id: { - int16_t AbsMinCoolSetpointLimit; - int16_t AbsMaxCoolSetpointLimit; - int16_t MinCoolSetpointLimit; - int16_t MaxCoolSetpointLimit; - - status = AbsMinCoolSetpointLimit::Get(endpoint, &AbsMinCoolSetpointLimit); - if (status != EMBER_ZCL_STATUS_SUCCESS) + requested = static_cast(chip::Encoding::LittleEndian::Get16(value)); + if (!CoolSupported) + return imcode::UnsupportedAttribute; + else if (requested < AbsMinCoolSetpointLimit || requested < MinCoolSetpointLimit || requested > AbsMaxCoolSetpointLimit || + requested > MaxCoolSetpointLimit) + return imcode::InvalidValue; + else if (AutoSupported) { - AbsMinCoolSetpointLimit = kDefaultAbsMinCoolSetpointLimit; + if (requested < OccupiedHeatingSetpoint + DeadBandTemp) + return imcode::InvalidValue; } + return imcode::Success; + } - status = AbsMaxCoolSetpointLimit::Get(endpoint, &AbsMaxCoolSetpointLimit); - if (status != EMBER_ZCL_STATUS_SUCCESS) + case UnoccupiedHeatingSetpoint::Id: { + requested = static_cast(chip::Encoding::LittleEndian::Get16(value)); + if (!(HeatSupported && OccupancySupported)) + return imcode::UnsupportedAttribute; + else if (requested < AbsMinHeatSetpointLimit || requested < MinHeatSetpointLimit || requested > AbsMaxHeatSetpointLimit || + requested > MaxHeatSetpointLimit) + return imcode::InvalidValue; + else if (AutoSupported) { - AbsMaxCoolSetpointLimit = kDefaultAbsMaxCoolSetpointLimit; + if (requested > UnoccupiedCoolingSetpoint - DeadBandTemp) + return imcode::InvalidValue; } - - status = MinCoolSetpointLimit::Get(endpoint, &MinCoolSetpointLimit); - if (status != EMBER_ZCL_STATUS_SUCCESS) + return imcode::Success; + } + case UnoccupiedCoolingSetpoint::Id: { + requested = static_cast(chip::Encoding::LittleEndian::Get16(value)); + if (!(CoolSupported && OccupancySupported)) + return imcode::UnsupportedAttribute; + else if (requested < AbsMinCoolSetpointLimit || requested < MinCoolSetpointLimit || requested > AbsMaxCoolSetpointLimit || + requested > MaxCoolSetpointLimit) + return imcode::InvalidValue; + else if (AutoSupported) { - MinCoolSetpointLimit = AbsMinCoolSetpointLimit; + if (requested < UnoccupiedHeatingSetpoint + DeadBandTemp) + return imcode::InvalidValue; } + return imcode::Success; + } - status = MaxCoolSetpointLimit::Get(endpoint, &MaxCoolSetpointLimit); - if (status != EMBER_ZCL_STATUS_SUCCESS) + case MinHeatSetpointLimit::Id: { + requested = static_cast(chip::Encoding::LittleEndian::Get16(value)); + if (!HeatSupported) + return imcode::UnsupportedAttribute; + else if (requested < AbsMinHeatSetpointLimit || requested > MaxHeatSetpointLimit || requested > AbsMaxHeatSetpointLimit) + return imcode::InvalidValue; + else if (AutoSupported) { - MaxCoolSetpointLimit = AbsMaxCoolSetpointLimit; + if (requested > MinCoolSetpointLimit - DeadBandTemp) + return imcode::InvalidValue; } - requested = static_cast(chip::Encoding::LittleEndian::Get16(value)); - if (requested < AbsMinCoolSetpointLimit || requested < MinCoolSetpointLimit || requested > AbsMaxCoolSetpointLimit || - requested > MaxCoolSetpointLimit) - status = EMBER_ZCL_STATUS_INVALID_VALUE; - else - status = EMBER_ZCL_STATUS_SUCCESS; - - break; + return imcode::Success; } - - case MinHeatSetpointLimit::Id: case MaxHeatSetpointLimit::Id: { - int16_t AbsMinHeatSetpointLimit; - int16_t AbsMaxHeatSetpointLimit; - - status = AbsMinHeatSetpointLimit::Get(endpoint, &AbsMinHeatSetpointLimit); - if (status != EMBER_ZCL_STATUS_SUCCESS) + requested = static_cast(chip::Encoding::LittleEndian::Get16(value)); + if (!HeatSupported) + return imcode::UnsupportedAttribute; + else if (requested < AbsMinHeatSetpointLimit || requested < MinHeatSetpointLimit || requested > AbsMaxHeatSetpointLimit) + return imcode::InvalidValue; + else if (AutoSupported) { - AbsMinHeatSetpointLimit = kDefaultAbsMinHeatSetpointLimit; + if (requested > MaxCoolSetpointLimit - DeadBandTemp) + return imcode::InvalidValue; } - - status = AbsMaxHeatSetpointLimit::Get(endpoint, &AbsMaxHeatSetpointLimit); - if (status != EMBER_ZCL_STATUS_SUCCESS) + return imcode::Success; + } + case MinCoolSetpointLimit::Id: { + requested = static_cast(chip::Encoding::LittleEndian::Get16(value)); + if (!CoolSupported) + return imcode::UnsupportedAttribute; + else if (requested < AbsMinCoolSetpointLimit || requested > MaxCoolSetpointLimit || requested > AbsMaxCoolSetpointLimit) + return imcode::InvalidValue; + else if (AutoSupported) { - AbsMaxHeatSetpointLimit = kDefaultAbsMaxHeatSetpointLimit; + if (requested < MinHeatSetpointLimit + DeadBandTemp) + return imcode::InvalidValue; } - - requested = static_cast(chip::Encoding::LittleEndian::Get16(value)); - if (requested < AbsMinHeatSetpointLimit || requested > AbsMaxHeatSetpointLimit) - status = EMBER_ZCL_STATUS_INVALID_VALUE; - else - status = EMBER_ZCL_STATUS_SUCCESS; - - break; + return imcode::Success; } - case MinCoolSetpointLimit::Id: case MaxCoolSetpointLimit::Id: { - int16_t AbsMinCoolSetpointLimit; - int16_t AbsMaxCoolSetpointLimit; - - status = AbsMinCoolSetpointLimit::Get(endpoint, &AbsMinCoolSetpointLimit); - if (status != EMBER_ZCL_STATUS_SUCCESS) - { - AbsMinCoolSetpointLimit = kDefaultAbsMinCoolSetpointLimit; - } - - status = AbsMaxCoolSetpointLimit::Get(endpoint, &AbsMaxCoolSetpointLimit); - if (status != EMBER_ZCL_STATUS_SUCCESS) + requested = static_cast(chip::Encoding::LittleEndian::Get16(value)); + if (!CoolSupported) + return imcode::UnsupportedAttribute; + else if (requested < AbsMinCoolSetpointLimit || requested < MinCoolSetpointLimit || requested > AbsMaxCoolSetpointLimit) + return imcode::InvalidValue; + else if (AutoSupported) { - AbsMaxCoolSetpointLimit = kDefaultAbsMaxCoolSetpointLimit; + if (requested < MaxHeatSetpointLimit + DeadBandTemp) + return imcode::InvalidValue; } - - requested = static_cast(chip::Encoding::LittleEndian::Get16(value)); - if (requested < AbsMinCoolSetpointLimit || requested > AbsMaxCoolSetpointLimit) - status = EMBER_ZCL_STATUS_INVALID_VALUE; - else - status = EMBER_ZCL_STATUS_SUCCESS; - - break; + return imcode::Success; + } + case MinSetpointDeadBand::Id: { + requested = *value; + if (!AutoSupported) + return imcode::UnsupportedAttribute; + else if (requested < 0 || requested > 25) + return imcode::InvalidValue; + return imcode::Success; } case ControlSequenceOfOperation::Id: { uint8_t requestedCSO; requestedCSO = *value; if (requestedCSO > EMBER_ZCL_THERMOSTAT_CONTROL_SEQUENCE_COOLING_AND_HEATING_WITH_REHEAT) - status = EMBER_ZCL_STATUS_INVALID_VALUE; - else - status = EMBER_ZCL_STATUS_SUCCESS; - - break; + return imcode::InvalidValue; + return imcode::Success; } case SystemMode::Id: { @@ -227,7 +332,7 @@ MatterThermostatClusterServerPreAttributeChangedCallback(const app::ConcreteAttr if (ControlSequenceOfOperation > EMBER_ZCL_THERMOSTAT_CONTROL_SEQUENCE_COOLING_AND_HEATING_WITH_REHEAT || RequestedSystemMode > EMBER_ZCL_THERMOSTAT_SYSTEM_MODE_FAN_ONLY) { - status = EMBER_ZCL_STATUS_INVALID_VALUE; + return imcode::InvalidValue; } else { @@ -237,26 +342,25 @@ MatterThermostatClusterServerPreAttributeChangedCallback(const app::ConcreteAttr case EMBER_ZCL_THERMOSTAT_CONTROL_SEQUENCE_COOLING_WITH_REHEAT: if (RequestedSystemMode == EMBER_ZCL_THERMOSTAT_SYSTEM_MODE_HEAT || RequestedSystemMode == EMBER_ZCL_THERMOSTAT_SYSTEM_MODE_EMERGENCY_HEATING) - status = EMBER_ZCL_STATUS_INVALID_VALUE; - break; + return imcode::InvalidValue; + else + return imcode::Success; case EMBER_ZCL_THERMOSTAT_CONTROL_SEQUENCE_HEATING_ONLY: case EMBER_ZCL_THERMOSTAT_CONTROL_SEQUENCE_HEATING_WITH_REHEAT: if (RequestedSystemMode == EMBER_ZCL_THERMOSTAT_SYSTEM_MODE_COOL || RequestedSystemMode == EMBER_ZCL_THERMOSTAT_SYSTEM_MODE_PRECOOLING) - status = EMBER_ZCL_STATUS_INVALID_VALUE; - break; + return imcode::InvalidValue; + else + return imcode::Success; default: - break; + return imcode::Success; } } - break; } default: - break; + return imcode::Success; } - - return app::ToInteractionModelStatus(status); } bool emberAfThermostatClusterClearWeeklyScheduleCallback(app::CommandHandler * commandObj, @@ -444,82 +548,229 @@ bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * co int16_t HeatingSetpoint = kDefaultHeatingSetpoint, CoolingSetpoint = kDefaultCoolingSetpoint; // Set to defaults to be safe EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE; - EmberAfStatus ReadStatus = EMBER_ZCL_STATUS_FAILURE; - EmberAfStatus WriteCoolingSetpointStatus = EMBER_ZCL_STATUS_SUCCESS, WriteHeatingSetpointStatus = EMBER_ZCL_STATUS_SUCCESS; + EmberAfStatus WriteCoolingSetpointStatus = EMBER_ZCL_STATUS_FAILURE; + EmberAfStatus WriteHeatingSetpointStatus = EMBER_ZCL_STATUS_FAILURE; + bool AutoSupported = false; + bool HeatSupported = false; + bool CoolSupported = false; + int16_t DeadBandTemp = 0; + int8_t DeadBand = 0; + uint32_t FeatureMap = 0; + + // TODO re-enable reading reaturemap once https://github.com/project-chip/connectedhomeip/pull/9725 is merged +#ifndef FEATURE_MAP_OVERIDE + emberAfReadServerAttribute(endpoint, Thermostat::Id, chip::app::Clusters::Globals::Attributes::Ids::FeatureMap, + (uint8_t *) &FeatureMap, sizeof(FeatureMap)); +#else + FeatureMap = FEATURE_MAP_OVERIDE; +#endif + + if (FeatureMap & 1 << 5) // Bit 5 is Auto Mode supported + { + AutoSupported = true; + if (MinSetpointDeadBand::Get(aEndpointId, &DeadBand) != EMBER_ZCL_STATUS_SUCCESS) + DeadBand = kDefaultDeadBand; + DeadBandTemp = static_cast(DeadBand * 10); + } + if (FeatureMap & 1 << 0) + HeatSupported = true; + + if (FeatureMap & 1 << 1) + CoolSupported = true; switch (mode) { case EMBER_ZCL_SETPOINT_ADJUST_MODE_HEAT_AND_COOL_SETPOINTS: + if (HeatSupported && CoolSupported) + { + int16_t DesiredCoolingSetpoint, CoolLimit, DesiredHeatingSetpoint, HeatLimit; + if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS) + { + DesiredCoolingSetpoint = static_cast(CoolingSetpoint + amount * 10); + CoolLimit = static_cast(DesiredCoolingSetpoint - + EnforceCoolingSetpointLimits(DesiredCoolingSetpoint, aEndpointId)); + { + if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS) + { + DesiredHeatingSetpoint = static_cast(HeatingSetpoint + amount * 10); + HeatLimit = static_cast(DesiredHeatingSetpoint - + EnforceHeatingSetpointLimits(DesiredHeatingSetpoint, aEndpointId)); + { + if (CoolLimit != 0 || HeatLimit != 0) + { + if (abs(CoolLimit) <= abs(HeatLimit)) + { + // We are limited by the Heating Limit + DesiredHeatingSetpoint = static_cast(DesiredHeatingSetpoint - HeatLimit); + DesiredCoolingSetpoint = static_cast(DesiredCoolingSetpoint - HeatLimit); + } + else + { + // We are limited by Cooling Limit + DesiredHeatingSetpoint = static_cast(DesiredHeatingSetpoint - CoolLimit); + DesiredCoolingSetpoint = static_cast(DesiredCoolingSetpoint - CoolLimit); + } + } + WriteCoolingSetpointStatus = OccupiedCoolingSetpoint::Set(aEndpointId, DesiredCoolingSetpoint); + if (WriteCoolingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(Zcl, "Error: SetOccupiedCoolingSetpoint failed!"); + } + WriteHeatingSetpointStatus = OccupiedHeatingSetpoint::Set(aEndpointId, DesiredHeatingSetpoint); + if (WriteHeatingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(Zcl, "Error: SetOccupiedHeatingSetpoint failed!"); + } + } + } + } + } + } - // https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/3726 - // Behavior is not specified if the device only contains one mode - // and the both mode command is sent. - // Implemented behavior is not perfect, but spec needs to be clear before changing the implementaion - - // 4.3.7.2.1. Both - // [4.172] The client MAY indicate Both regardless of the server feature support. The server SHALL - // only adjust the setpoint that it supports and not respond with an error. - - // Implementation assumes that the attribute will NOT be present if the device does not support that mode. - - // In auto mode we will need to change both the heating and cooling setpoints - ReadStatus = OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint); - if (ReadStatus == EMBER_ZCL_STATUS_SUCCESS) + if (CoolSupported && !HeatSupported) { - CoolingSetpoint = static_cast(CoolingSetpoint + amount * 10); - CoolingSetpoint = EnforceCoolingSetpointLimits(CoolingSetpoint, aEndpointId); - WriteCoolingSetpointStatus = OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint); - if (WriteCoolingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS) + if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS) { - ChipLogError(Zcl, "Error: SetOccupiedCoolingSetpoint failed!"); + CoolingSetpoint = static_cast(CoolingSetpoint + amount * 10); + CoolingSetpoint = EnforceCoolingSetpointLimits(CoolingSetpoint, aEndpointId); + WriteCoolingSetpointStatus = OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint); + if (WriteCoolingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(Zcl, "Error: SetOccupiedCoolingSetpoint failed!"); + } } } - ReadStatus = OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint); - if (ReadStatus == EMBER_ZCL_STATUS_SUCCESS) + if (HeatSupported && !CoolSupported) { - HeatingSetpoint = static_cast(HeatingSetpoint + amount * 10); - HeatingSetpoint = EnforceHeatingSetpointLimits(HeatingSetpoint, aEndpointId); - WriteHeatingSetpointStatus = OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint); - if (WriteHeatingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS) + if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS) { - ChipLogError(Zcl, "Error: SetOccupiedHeatingSetpoint failed!"); + HeatingSetpoint = static_cast(HeatingSetpoint + amount * 10); + HeatingSetpoint = EnforceHeatingSetpointLimits(HeatingSetpoint, aEndpointId); + WriteHeatingSetpointStatus = OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint); + if (WriteHeatingSetpointStatus != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(Zcl, "Error: SetOccupiedHeatingSetpoint failed!"); + } } } - // https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/3801 - // Spec behavior is not defined if one was successfull and the other not what should happen. - // this implementation leaves the successfull one changed but will return an error. - if ((WriteCoolingSetpointStatus == EMBER_ZCL_STATUS_SUCCESS) && (WriteHeatingSetpointStatus == EMBER_ZCL_STATUS_SUCCESS)) + + if ((!HeatSupported || WriteHeatingSetpointStatus == EMBER_ZCL_STATUS_SUCCESS) && + (!CoolSupported || WriteCoolingSetpointStatus == EMBER_ZCL_STATUS_SUCCESS)) status = EMBER_ZCL_STATUS_SUCCESS; break; case EMBER_ZCL_SETPOINT_ADJUST_MODE_COOL_SETPOINT: - // In cooling mode we will need to change only the cooling setpoint - ReadStatus = OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint); - - if (ReadStatus == EMBER_ZCL_STATUS_SUCCESS) + if (CoolSupported) { - CoolingSetpoint = static_cast(CoolingSetpoint + amount * 10); - CoolingSetpoint = EnforceCoolingSetpointLimits(CoolingSetpoint, aEndpointId); - status = OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint); + if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS) + { + CoolingSetpoint = static_cast(CoolingSetpoint + amount * 10); + CoolingSetpoint = EnforceCoolingSetpointLimits(CoolingSetpoint, aEndpointId); + if (AutoSupported) + { + // Need to check if we can move the cooling setpoint while maintaining the dead band + if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS) + { + if (CoolingSetpoint - HeatingSetpoint < DeadBandTemp) + { + // Dead Band Violation + // Try to adjust it + HeatingSetpoint = static_cast(CoolingSetpoint - DeadBandTemp); + if (HeatingSetpoint == EnforceHeatingSetpointLimits(HeatingSetpoint, aEndpointId)) + { + // Desired cooling setpoint is enforcable + // Set the new cooling and heating setpoints + if (OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS) + { + if (OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS) + status = EMBER_ZCL_STATUS_SUCCESS; + } + else + ChipLogError(Zcl, "Error: SetOccupiedHeatingSetpoint failed!"); + } + else + { + ChipLogError(Zcl, "Error: Could Not adjust heating setpoint to maintain dead band!"); + status = EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + } + else + status = OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint); + } + else + ChipLogError(Zcl, "Error: GetOccupiedHeatingSetpoint failed!"); + } + else + { + status = OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint); + } + } + else + ChipLogError(Zcl, "Error: GetOccupiedCoolingSetpoint failed!"); } + else + status = EMBER_ZCL_STATUS_INVALID_ARGUMENT; break; case EMBER_ZCL_SETPOINT_ADJUST_MODE_HEAT_SETPOINT: - // In cooling mode we will need to change only the cooling setpoint - ReadStatus = OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint); - if (ReadStatus == EMBER_ZCL_STATUS_SUCCESS) + if (HeatSupported) { - HeatingSetpoint = static_cast(HeatingSetpoint + amount * 10); - HeatingSetpoint = EnforceHeatingSetpointLimits(HeatingSetpoint, aEndpointId); - status = OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint); + if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS) + { + HeatingSetpoint = static_cast(HeatingSetpoint + amount * 10); + HeatingSetpoint = EnforceHeatingSetpointLimits(HeatingSetpoint, aEndpointId); + if (AutoSupported) + { + // Need to check if we can move the cooling setpoint while maintaining the dead band + if (OccupiedCoolingSetpoint::Get(aEndpointId, &CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS) + { + if (CoolingSetpoint - HeatingSetpoint < DeadBandTemp) + { + // Dead Band Violation + // Try to adjust it + CoolingSetpoint = static_cast(HeatingSetpoint + DeadBandTemp); + if (CoolingSetpoint == EnforceCoolingSetpointLimits(CoolingSetpoint, aEndpointId)) + { + // Desired cooling setpoint is enforcable + // Set the new cooling and heating setpoints + if (OccupiedCoolingSetpoint::Set(aEndpointId, CoolingSetpoint) == EMBER_ZCL_STATUS_SUCCESS) + { + if (OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint) == EMBER_ZCL_STATUS_SUCCESS) + status = EMBER_ZCL_STATUS_SUCCESS; + } + else + ChipLogError(Zcl, "Error: SetOccupiedCoolingSetpoint failed!"); + } + else + { + ChipLogError(Zcl, "Error: Could Not adjust cooling setpoint to maintain dead band!"); + status = EMBER_ZCL_STATUS_INVALID_ARGUMENT; + } + } + else + status = OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint); + } + else + ChipLogError(Zcl, "Error: GetOccupiedCoolingSetpoint failed!"); + } + else + { + status = OccupiedHeatingSetpoint::Set(aEndpointId, HeatingSetpoint); + } + } + else + ChipLogError(Zcl, "Error: GetOccupiedHeatingSetpoint failed!"); } + else + status = EMBER_ZCL_STATUS_INVALID_ARGUMENT; break; default: - // Nothing to do here + status = EMBER_ZCL_STATUS_INVALID_ARGUMENT; break; } + emberAfSendImmediateDefaultResponse(status); return true; } diff --git a/src/app/data-model/Decode.h b/src/app/data-model/Decode.h index d4367ab1ea55b3..3131682f1f10cc 100644 --- a/src/app/data-model/Decode.h +++ b/src/app/data-model/Decode.h @@ -18,9 +18,11 @@ #pragma once +#include #include #include #include +#include namespace chip { namespace app { @@ -93,6 +95,37 @@ CHIP_ERROR Decode(TLV::TLVReader & reader, X & x) return x.Decode(reader); } +/* + * @brief + * + * Decodes an optional value (struct field, command field, event field). + */ +template +CHIP_ERROR Decode(TLV::TLVReader & reader, Optional & x) +{ + // If we are calling this, it means we found the right tag, so just decode + // the item. + return Decode(reader, x.Emplace()); +} + +/* + * @brief + * + * Decodes a nullable value. + */ +template +CHIP_ERROR Decode(TLV::TLVReader & reader, Nullable & x) +{ + if (reader.GetType() == TLV::kTLVType_Null) + { + x.SetNull(); + return CHIP_NO_ERROR; + } + + // We have a value; decode it. + return Decode(reader, x.SetNonNull()); +} + } // namespace DataModel } // namespace app } // namespace chip diff --git a/src/app/data-model/Encode.h b/src/app/data-model/Encode.h index 5630b10c9b08f5..d4556b0d43880e 100644 --- a/src/app/data-model/Encode.h +++ b/src/app/data-model/Encode.h @@ -18,7 +18,9 @@ #pragma once +#include #include +#include namespace chip { namespace app { @@ -78,6 +80,37 @@ CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag, const X & x) return x.Encode(writer, tag); } +/* + * @brief + * + * Encodes an optional value (struct field, command field, event field). + */ +template +CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag, const Optional & x) +{ + if (x.HasValue()) + { + return Encode(writer, tag, x.Value()); + } + // If no value, just do nothing. + return CHIP_NO_ERROR; +} + +/* + * @brief + * + * Encodes a nullable value. + */ +template +CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag, const Nullable & x) +{ + if (x.IsNull()) + { + return writer.PutNull(tag); + } + return Encode(writer, tag, x.Value()); +} + } // namespace DataModel } // namespace app } // namespace chip diff --git a/src/app/data-model/Nullable.h b/src/app/data-model/Nullable.h new file mode 100644 index 00000000000000..50efceb7aa6f95 --- /dev/null +++ b/src/app/data-model/Nullable.h @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2020-2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace chip { +namespace app { +namespace DataModel { + +/* + * Dedicated type for nullable things, to differentiate them from optional + * things. + */ +template +struct Nullable : protected Optional +{ + // + // The following 'using' statement is needed to make visible + // all constructors of the base class within this derived class. + // + using Optional::Optional; + + // Pull in APIs that make sense on Nullable with the same names as on + // Optional. + using Optional::Value; + + constexpr void SetNull() { Optional::ClearValue(); } + constexpr bool IsNull() const { return !Optional::HasValue(); } + + template + constexpr T & SetNonNull(Args &&... args) + { + return Optional::Emplace(std::forward(args)...); + } +}; + +} // namespace DataModel +} // namespace app +} // namespace chip diff --git a/src/app/tests/AppTestContext.cpp b/src/app/tests/AppTestContext.cpp new file mode 100644 index 00000000000000..2d3d1b20fbca8c --- /dev/null +++ b/src/app/tests/AppTestContext.cpp @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include + +namespace chip { +namespace Test { + +CHIP_ERROR AppContext::Init() +{ + ReturnErrorOnFailure(chip::Platform::MemoryInit()); + ReturnErrorOnFailure(mIOContext.Init()); + ReturnErrorOnFailure(mTransportManager.Init("LOOPBACK")); + ReturnErrorOnFailure(MessagingContext::Init(&mTransportManager, &mIOContext)); + ReturnErrorOnFailure(chip::app::InteractionModelEngine::GetInstance()->Init(&GetExchangeManager(), nullptr)); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR AppContext::Shutdown() +{ + ReturnErrorOnFailure(MessagingContext::Shutdown()); + ReturnErrorOnFailure(mIOContext.Shutdown()); + chip::Platform::MemoryShutdown(); + + return CHIP_NO_ERROR; +} + +} // namespace Test +} // namespace chip diff --git a/src/app/tests/AppTestContext.h b/src/app/tests/AppTestContext.h new file mode 100644 index 00000000000000..469dbf23c5c09c --- /dev/null +++ b/src/app/tests/AppTestContext.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include +#include + +#include + +namespace chip { +namespace Test { + +/** + * @brief The context of test cases for messaging layer. It wil initialize network layer and system layer, and create + * two secure sessions, connected with each other. Exchanges can be created for each secure session. + */ +class AppContext : public MessagingContext +{ +public: + /// Initialize the underlying layers and test suite pointer + CHIP_ERROR Init(); + + // Shutdown all layers, finalize operations + CHIP_ERROR Shutdown(); + + static int Initialize(void * context) + { + auto * ctx = static_cast(context); + return ctx->Init() == CHIP_NO_ERROR ? SUCCESS : FAILURE; + } + + static int Finalize(void * context) + { + auto * ctx = static_cast(context); + return ctx->Shutdown() == CHIP_NO_ERROR ? SUCCESS : FAILURE; + } + +private: + chip::TransportMgr mTransportManager; + chip::Test::IOContext mIOContext; +}; + +} // namespace Test +} // namespace chip diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index 12ad872bbe47c7..9bfd53e0622530 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -19,6 +19,24 @@ import("//build_overrides/nlunit_test.gni") import("${chip_root}/build/chip/chip_test_suite.gni") import("${chip_root}/src/platform/device.gni") +static_library("helpers") { + output_name = "libAppTestHelpers" + output_dir = "${root_out_dir}/lib" + + sources = [ + "AppTestContext.cpp", + "AppTestContext.h", + ] + + cflags = [ "-Wconversion" ] + + deps = [ + "${chip_root}/src/lib/support", + "${chip_root}/src/messaging/tests:helpers", + "${chip_root}/src/transport/raw/tests:helpers", + ] +} + chip_test_suite("tests") { output_name = "libAppTests" @@ -49,11 +67,9 @@ chip_test_suite("tests") { public_deps = [ "${chip_root}/src/app", "${chip_root}/src/app/common:cluster-objects", + "${chip_root}/src/app/tests:helpers", "${chip_root}/src/app/util:device_callbacks_manager", "${chip_root}/src/lib/core", - "${chip_root}/src/messaging/tests:helpers", - "${chip_root}/src/protocols", - "${chip_root}/src/transport/raw/tests:helpers", "${nlunit_test_root}:nlunit-test", ] diff --git a/src/app/tests/TestCommandInteraction.cpp b/src/app/tests/TestCommandInteraction.cpp index d40a0ed62529ca..181f9d71e8df26 100644 --- a/src/app/tests/TestCommandInteraction.cpp +++ b/src/app/tests/TestCommandInteraction.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -36,34 +37,21 @@ #include #include #include -#include #include #include -#include -#include -#include #include #include -#include -#include -#include #include -using namespace chip; +using TestContext = chip::Test::AppContext; + namespace chip { namespace { -chip::TransportMgrBase gTransportManager; -chip::Test::LoopbackTransport gLoopback; -chip::Test::IOContext gIOContext; -Messaging::ExchangeManager * gExchangeManager; -secure_channel::MessageCounterManager gMessageCounterManager; FabricIndex gFabricIndex = 0; bool isCommandDispatched = false; -using TestContext = chip::Test::MessagingContext; -TestContext sContext; bool sendResponse = true; constexpr EndpointId kTestEndpointId = 1; @@ -294,9 +282,10 @@ void TestCommandInteraction::AddCommandDataIB(nlTestSuite * apSuite, void * apCo void TestCommandInteraction::TestCommandSenderWithWrongState(nlTestSuite * apSuite, void * apContext) { - CHIP_ERROR err = CHIP_NO_ERROR; + TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; - app::CommandSender commandSender(&mockCommandSenderDelegate, gExchangeManager); + app::CommandSender commandSender(&mockCommandSenderDelegate, &ctx.GetExchangeManager()); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); err = commandSender.SendCommandRequest(kTestDeviceNodeId, gFabricIndex, Optional::Missing()); @@ -305,6 +294,7 @@ void TestCommandInteraction::TestCommandSenderWithWrongState(nlTestSuite * apSui void TestCommandInteraction::TestCommandHandlerWithWrongState(nlTestSuite * apSuite, void * apContext) { + TestContext & ctx = *static_cast(apContext); CHIP_ERROR err = CHIP_NO_ERROR; auto commandPathParams = MakeTestCommandPath(); @@ -313,7 +303,7 @@ void TestCommandInteraction::TestCommandHandlerWithWrongState(nlTestSuite * apSu err = commandHandler.PrepareCommand(commandPathParams); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - auto exchangeCtx = gExchangeManager->NewContext(SessionHandle(0, 0, 0, 0), nullptr); + auto exchangeCtx = ctx.GetExchangeManager().NewContext(SessionHandle(0, 0, 0, 0), nullptr); commandHandler.mpExchangeCtx = exchangeCtx; TestExchangeDelegate delegate; commandHandler.mpExchangeCtx->SetDelegate(&delegate); @@ -324,15 +314,17 @@ void TestCommandInteraction::TestCommandHandlerWithWrongState(nlTestSuite * apSu void TestCommandInteraction::TestCommandSenderWithSendCommand(nlTestSuite * apSuite, void * apContext) { - CHIP_ERROR err = CHIP_NO_ERROR; + TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; - app::CommandSender commandSender(&mockCommandSenderDelegate, gExchangeManager); + app::CommandSender commandSender(&mockCommandSenderDelegate, &ctx.GetExchangeManager()); System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); AddCommandDataIB(apSuite, apContext, &commandSender, false); - err = commandSender.SendCommandRequest(kTestDeviceNodeId, gFabricIndex, Optional::Missing()); - NL_TEST_ASSERT(apSuite, err == CHIP_ERROR_NOT_CONNECTED); + err = + commandSender.SendCommandRequest(0 /* nodeid */, 0 /* fabricindex */, Optional(ctx.GetSessionBobToAlice())); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); GenerateReceivedCommand(apSuite, apContext, buf, true /*aNeedCommandData*/); err = commandSender.ProcessCommandMessage(std::move(buf), Command::CommandRoleId::SenderId); @@ -341,13 +333,14 @@ void TestCommandInteraction::TestCommandSenderWithSendCommand(nlTestSuite * apSu void TestCommandInteraction::TestCommandHandlerWithSendEmptyCommand(nlTestSuite * apSuite, void * apContext) { + TestContext & ctx = *static_cast(apContext); CHIP_ERROR err = CHIP_NO_ERROR; auto commandPathParams = MakeTestCommandPath(); app::CommandHandler commandHandler(&mockCommandHandlerDelegate); System::PacketBufferHandle commandDatabuf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); - auto exchangeCtx = gExchangeManager->NewContext(SessionHandle(0, 0, 0, 0), nullptr); + auto exchangeCtx = ctx.GetExchangeManager().NewContext(SessionHandle(0, 0, 0, 0), nullptr); commandHandler.mpExchangeCtx = exchangeCtx; TestExchangeDelegate delegate; @@ -362,9 +355,10 @@ void TestCommandInteraction::TestCommandHandlerWithSendEmptyCommand(nlTestSuite void TestCommandInteraction::TestCommandSenderWithProcessReceivedMsg(nlTestSuite * apSuite, void * apContext) { - CHIP_ERROR err = CHIP_NO_ERROR; + TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; - app::CommandSender commandSender(&mockCommandSenderDelegate, gExchangeManager); + app::CommandSender commandSender(&mockCommandSenderDelegate, &ctx.GetExchangeManager()); System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); @@ -375,11 +369,12 @@ void TestCommandInteraction::TestCommandSenderWithProcessReceivedMsg(nlTestSuite void TestCommandInteraction::ValidateCommandHandlerWithSendCommand(nlTestSuite * apSuite, void * apContext, bool aNeedStatusCode) { - CHIP_ERROR err = CHIP_NO_ERROR; + TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; app::CommandHandler commandHandler(&mockCommandHandlerDelegate); System::PacketBufferHandle commandPacket; - auto exchangeCtx = gExchangeManager->NewContext(SessionHandle(0, 0, 0, 0), nullptr); + auto exchangeCtx = ctx.GetExchangeManager().NewContext(SessionHandle(0, 0, 0, 0), nullptr); commandHandler.mpExchangeCtx = exchangeCtx; TestExchangeDelegate delegate; @@ -422,11 +417,12 @@ struct Fields void TestCommandInteraction::TestCommandHandlerCommandDataEncoding(nlTestSuite * apSuite, void * apContext) { - CHIP_ERROR err = CHIP_NO_ERROR; + TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; app::CommandHandler commandHandler(nullptr); System::PacketBufferHandle commandPacket; - commandHandler.mpExchangeCtx = gExchangeManager->NewContext(SessionHandle(0, 0, 0, 0), nullptr); + commandHandler.mpExchangeCtx = ctx.GetExchangeManager().NewContext(SessionHandle(0, 0, 0, 0), nullptr); TestExchangeDelegate delegate; commandHandler.mpExchangeCtx->SetDelegate(&delegate); @@ -500,11 +496,11 @@ void TestCommandInteraction::TestCommandHandlerWithProcessReceivedEmptyDataMsg(n void TestCommandInteraction::TestCommandSenderCommandSuccessResponseFlow(nlTestSuite * apSuite, void * apContext) { - CHIP_ERROR err = CHIP_NO_ERROR; TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; mockCommandSenderDelegate.ResetCounter(); - app::CommandSender commandSender(&mockCommandSenderDelegate, gExchangeManager); + app::CommandSender commandSender(&mockCommandSenderDelegate, &ctx.GetExchangeManager()); AddCommandDataIB(apSuite, apContext, &commandSender, false); err = commandSender.SendCommandRequest(0, 0, Optional(ctx.GetSessionBobToAlice())); @@ -514,16 +510,16 @@ void TestCommandInteraction::TestCommandSenderCommandSuccessResponseFlow(nlTestS mockCommandSenderDelegate.onErrorCalledTimes == 0); NL_TEST_ASSERT(apSuite, GetNumActiveHandlerObjects() == 0); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } void TestCommandInteraction::TestCommandSenderCommandSpecificResponseFlow(nlTestSuite * apSuite, void * apContext) { - CHIP_ERROR err = CHIP_NO_ERROR; TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; mockCommandSenderDelegate.ResetCounter(); - app::CommandSender commandSender(&mockCommandSenderDelegate, gExchangeManager); + app::CommandSender commandSender(&mockCommandSenderDelegate, &ctx.GetExchangeManager()); AddCommandDataIB(apSuite, apContext, &commandSender, false, kTestCommandIdCommandSpecificResponse); err = commandSender.SendCommandRequest(0, 0, Optional(ctx.GetSessionBobToAlice())); @@ -533,16 +529,16 @@ void TestCommandInteraction::TestCommandSenderCommandSpecificResponseFlow(nlTest mockCommandSenderDelegate.onErrorCalledTimes == 0); NL_TEST_ASSERT(apSuite, GetNumActiveHandlerObjects() == 0); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } void TestCommandInteraction::TestCommandSenderCommandFailureResponseFlow(nlTestSuite * apSuite, void * apContext) { - CHIP_ERROR err = CHIP_NO_ERROR; TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; mockCommandSenderDelegate.ResetCounter(); - app::CommandSender commandSender(&mockCommandSenderDelegate, gExchangeManager); + app::CommandSender commandSender(&mockCommandSenderDelegate, &ctx.GetExchangeManager()); AddCommandDataIB(apSuite, apContext, &commandSender, false, kTestNonExistCommandId); err = commandSender.SendCommandRequest(0, 0, Optional(ctx.GetSessionBobToAlice())); @@ -552,13 +548,13 @@ void TestCommandInteraction::TestCommandSenderCommandFailureResponseFlow(nlTestS mockCommandSenderDelegate.onErrorCalledTimes == 1); NL_TEST_ASSERT(apSuite, GetNumActiveHandlerObjects() == 0); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } void TestCommandInteraction::TestCommandSenderAbruptDestruction(nlTestSuite * apSuite, void * apContext) { - CHIP_ERROR err = CHIP_NO_ERROR; TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; // // Don't send back a response, just keep the CommandHandler @@ -569,7 +565,7 @@ void TestCommandInteraction::TestCommandSenderAbruptDestruction(nlTestSuite * ap mockCommandSenderDelegate.ResetCounter(); { - app::CommandSender commandSender(&mockCommandSenderDelegate, gExchangeManager); + app::CommandSender commandSender(&mockCommandSenderDelegate, &ctx.GetExchangeManager()); AddCommandDataIB(apSuite, apContext, &commandSender, false, kTestCommandIdCommandSpecificResponse); err = commandSender.SendCommandRequest(0, 0, Optional(ctx.GetSessionBobToAlice())); @@ -582,13 +578,13 @@ void TestCommandInteraction::TestCommandSenderAbruptDestruction(nlTestSuite * ap mockCommandSenderDelegate.onResponseCalledTimes == 0 && mockCommandSenderDelegate.onFinalCalledTimes == 0 && mockCommandSenderDelegate.onErrorCalledTimes == 0); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 1); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 1); } // // Upon the sender being destructed by the application, our exchange should get cleaned up too. // - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); NL_TEST_ASSERT(apSuite, GetNumActiveHandlerObjects() == 0); } @@ -620,51 +616,22 @@ const nlTest sTests[] = }; // clang-format on -int Initialize(void * aContext); -int Finalize(void * aContext); - // clang-format off nlTestSuite sSuite = { - "TestReadInteraction", - &sTests[0], - Initialize, - Finalize + "TestReadInteraction", + &sTests[0], + TestContext::Initialize, + TestContext::Finalize }; // clang-format on -int Initialize(void * aContext) -{ - // Initialize System memory and resources - VerifyOrReturnError(chip::Platform::MemoryInit() == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gIOContext.Init(&sSuite) == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gTransportManager.Init(&gLoopback) == CHIP_NO_ERROR, FAILURE); - - auto * ctx = static_cast(aContext); - VerifyOrReturnError(ctx->Init(&sSuite, &gTransportManager, &gIOContext) == CHIP_NO_ERROR, FAILURE); - - gTransportManager.SetSessionManager(&ctx->GetSecureSessionManager()); - gExchangeManager = &ctx->GetExchangeManager(); - VerifyOrReturnError( - chip::app::InteractionModelEngine::GetInstance()->Init(&ctx->GetExchangeManager(), nullptr) == CHIP_NO_ERROR, FAILURE); - return SUCCESS; -} - -int Finalize(void * aContext) -{ - // Shutdown will ensure no leaked exchange context. - CHIP_ERROR err = reinterpret_cast(aContext)->Shutdown(); - gIOContext.Shutdown(); - chip::Platform::MemoryShutdown(); - return (err == CHIP_NO_ERROR) ? SUCCESS : FAILURE; -} - } // namespace int TestCommandInteraction() { - nlTestRunner(&sSuite, &sContext); - + TestContext gContext; + nlTestRunner(&sSuite, &gContext); return (nlTestRunnerStats(&sSuite)); } diff --git a/src/app/tests/TestDataModelSerialization.cpp b/src/app/tests/TestDataModelSerialization.cpp index 9ad606016c76b1..f50ad5f7774ff3 100644 --- a/src/app/tests/TestDataModelSerialization.cpp +++ b/src/app/tests/TestDataModelSerialization.cpp @@ -23,6 +23,8 @@ */ #include +#include +#include #include #include #include @@ -50,8 +52,19 @@ class TestDataModelSerialization static void TestDataModelSerialization_InvalidSimpleFieldTypes(nlTestSuite * apSuite, void * apContext); static void TestDataModelSerialization_InvalidListType(nlTestSuite * apSuite, void * apContext); + static void NullablesOptionalsStruct(nlTestSuite * apSuite, void * apContext); + static void NullablesOptionalsCommand(nlTestSuite * apSuite, void * apContext); + void Shutdown(); +protected: + // Helper functions + template + static void NullablesOptionalsEncodeDecodeCheck(nlTestSuite * apSuite, void * apContext, bool encodeNulls, bool encodeValues); + + template + static void NullablesOptionalsEncodeDecodeCheck(nlTestSuite * apSuite, void * apContext); + private: void SetupBuf(); void DumpBuf(); @@ -847,6 +860,240 @@ void TestDataModelSerialization::TestDataModelSerialization_InvalidListType(nlTe } } +namespace { +bool SimpleStructsEqual(const TestCluster::Structs::SimpleStruct::Type & s1, const TestCluster::Structs::SimpleStruct::Type & s2) +{ + return s1.a == s2.a && s1.b == s2.b && s1.c == s2.c && s1.d.data_equal(s2.d) && s1.e.data_equal(s2.e) && s1.f == s2.f; +} + +template +bool ListsEqual(const DataModel::DecodableList & list1, const DataModel::List & list2) +{ + auto iter1 = list1.begin(); + auto iter2 = list2.begin(); + auto end2 = list2.end(); + while (iter1.Next()) + { + if (iter2 == end2) + { + // list2 too small + return false; + } + + if (iter1.GetValue() != *iter2) + { + return false; + } + ++iter2; + } + if (iter1.GetStatus() != CHIP_NO_ERROR) + { + // Failed to decode + return false; + } + if (iter2 != end2) + { + // list1 too small + return false; + } + return true; +} + +} // anonymous namespace + +template +void TestDataModelSerialization::NullablesOptionalsEncodeDecodeCheck(nlTestSuite * apSuite, void * apContext, bool encodeNulls, + bool encodeValues) +{ + auto * _this = static_cast(apContext); + + _this->mpSuite = apSuite; + _this->SetupBuf(); + + const char structStr[] = "something"; + const uint8_t structBytes[] = { 1, 8, 17 }; + TestCluster::Structs::SimpleStruct::Type myStruct; + myStruct.a = 17; + myStruct.b = true; +#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM + myStruct.c = TestCluster::SimpleEnum::kValueB; +#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM + myStruct.c = EMBER_ZCL_SIMPLE_ENUM_VALUE_B; +#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM + myStruct.d = ByteSpan(structBytes); + myStruct.e = CharSpan(structStr, strlen(structStr)); + myStruct.f = TestCluster::SimpleBitmap(2); + +#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM + TestCluster::SimpleEnum enumListVals[] = { TestCluster::SimpleEnum::kValueA, TestCluster::SimpleEnum::kValueC }; +#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM + TestCluster::SimpleEnum enumListVals[] = { EMBER_ZCL_SIMPLE_ENUM_VALUE_A, EMBER_ZCL_SIMPLE_ENUM_VALUE_C }; +#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM + DataModel::List enumList(enumListVals); + + // Encode + { + // str needs to live until we call DataModel::Encode. + const char str[] = "abc"; + CharSpan strSpan(str, strlen(str)); + Encodable encodable; + if (encodeNulls) + { + encodable.nullableInt.SetNull(); + encodable.nullableOptionalInt.Emplace().SetNull(); + + encodable.nullableString.SetNull(); + encodable.nullableOptionalString.Emplace().SetNull(); + + encodable.nullableStruct.SetNull(); + encodable.nullableOptionalStruct.Emplace().SetNull(); + + encodable.nullableList.SetNull(); + encodable.nullableOptionalList.Emplace().SetNull(); + } + else if (encodeValues) + { + encodable.nullableInt.SetNonNull(static_cast(5u)); + encodable.optionalInt.Emplace(static_cast(6u)); + encodable.nullableOptionalInt.Emplace().SetNonNull() = 7; + + encodable.nullableString.SetNonNull(strSpan); + encodable.optionalString.Emplace() = strSpan; + encodable.nullableOptionalString.Emplace().SetNonNull(strSpan); + + encodable.nullableStruct.SetNonNull(myStruct); + encodable.optionalStruct.Emplace(myStruct); + encodable.nullableOptionalStruct.Emplace().SetNonNull(myStruct); + + encodable.nullableList.SetNonNull() = enumList; + encodable.optionalList.Emplace(enumList); + encodable.nullableOptionalList.Emplace().SetNonNull(enumList); + } + else + { + // Just encode the non-optionals, as null. + encodable.nullableInt.SetNull(); + encodable.nullableString.SetNull(); + encodable.nullableStruct.SetNull(); + encodable.nullableList.SetNull(); + } + + CHIP_ERROR err = DataModel::Encode(_this->mWriter, TLV::AnonymousTag, encodable); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + err = _this->mWriter.Finalize(); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + } + + // Decode + { + _this->SetupReader(); + + Decodable decodable; + CHIP_ERROR err = DataModel::Decode(_this->mReader, decodable); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + if (encodeNulls) + { + NL_TEST_ASSERT(apSuite, decodable.nullableInt.IsNull()); + NL_TEST_ASSERT(apSuite, !decodable.optionalInt.HasValue()); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalInt.HasValue()); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalInt.Value().IsNull()); + + NL_TEST_ASSERT(apSuite, decodable.nullableString.IsNull()); + NL_TEST_ASSERT(apSuite, !decodable.optionalString.HasValue()); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalString.HasValue()); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalString.Value().IsNull()); + + NL_TEST_ASSERT(apSuite, decodable.nullableStruct.IsNull()); + NL_TEST_ASSERT(apSuite, !decodable.optionalStruct.HasValue()); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalStruct.HasValue()); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalStruct.Value().IsNull()); + + NL_TEST_ASSERT(apSuite, decodable.nullableList.IsNull()); + NL_TEST_ASSERT(apSuite, !decodable.optionalList.HasValue()); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalList.HasValue()); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalList.Value().IsNull()); + } + else if (encodeValues) + { + const char str[] = "abc"; + CharSpan strSpan(str, strlen(str)); + + NL_TEST_ASSERT(apSuite, !decodable.nullableInt.IsNull()); + NL_TEST_ASSERT(apSuite, decodable.nullableInt.Value() == 5); + NL_TEST_ASSERT(apSuite, decodable.optionalInt.HasValue()); + NL_TEST_ASSERT(apSuite, decodable.optionalInt.Value() == 6); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalInt.HasValue()); + NL_TEST_ASSERT(apSuite, !decodable.nullableOptionalInt.Value().IsNull()); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalInt.Value().Value() == 7); + + NL_TEST_ASSERT(apSuite, !decodable.nullableString.IsNull()); + NL_TEST_ASSERT(apSuite, decodable.nullableString.Value().data_equal(strSpan)); + NL_TEST_ASSERT(apSuite, decodable.optionalString.HasValue()); + NL_TEST_ASSERT(apSuite, decodable.optionalString.Value().data_equal(strSpan)); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalString.HasValue()); + NL_TEST_ASSERT(apSuite, !decodable.nullableOptionalString.Value().IsNull()); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalString.Value().Value().data_equal(strSpan)); + + NL_TEST_ASSERT(apSuite, !decodable.nullableStruct.IsNull()); + NL_TEST_ASSERT(apSuite, SimpleStructsEqual(decodable.nullableStruct.Value(), myStruct)); + NL_TEST_ASSERT(apSuite, decodable.optionalStruct.HasValue()); + NL_TEST_ASSERT(apSuite, SimpleStructsEqual(decodable.optionalStruct.Value(), myStruct)); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalStruct.HasValue()); + NL_TEST_ASSERT(apSuite, !decodable.nullableOptionalStruct.Value().IsNull()); + NL_TEST_ASSERT(apSuite, SimpleStructsEqual(decodable.nullableOptionalStruct.Value().Value(), myStruct)); + + NL_TEST_ASSERT(apSuite, !decodable.nullableList.IsNull()); + NL_TEST_ASSERT(apSuite, ListsEqual(decodable.nullableList.Value(), enumList)); + NL_TEST_ASSERT(apSuite, decodable.optionalList.HasValue()); + NL_TEST_ASSERT(apSuite, ListsEqual(decodable.optionalList.Value(), enumList)); + NL_TEST_ASSERT(apSuite, decodable.nullableOptionalList.HasValue()); + NL_TEST_ASSERT(apSuite, !decodable.nullableOptionalList.Value().IsNull()); + NL_TEST_ASSERT(apSuite, ListsEqual(decodable.nullableOptionalList.Value().Value(), enumList)); + } + else + { + NL_TEST_ASSERT(apSuite, decodable.nullableInt.IsNull()); + NL_TEST_ASSERT(apSuite, !decodable.optionalInt.HasValue()); + NL_TEST_ASSERT(apSuite, !decodable.nullableOptionalInt.HasValue()); + + NL_TEST_ASSERT(apSuite, decodable.nullableString.IsNull()); + NL_TEST_ASSERT(apSuite, !decodable.optionalString.HasValue()); + NL_TEST_ASSERT(apSuite, !decodable.nullableOptionalString.HasValue()); + + NL_TEST_ASSERT(apSuite, decodable.nullableStruct.IsNull()); + NL_TEST_ASSERT(apSuite, !decodable.optionalStruct.HasValue()); + NL_TEST_ASSERT(apSuite, !decodable.nullableOptionalStruct.HasValue()); + + NL_TEST_ASSERT(apSuite, decodable.nullableList.IsNull()); + NL_TEST_ASSERT(apSuite, !decodable.optionalList.HasValue()); + NL_TEST_ASSERT(apSuite, !decodable.nullableOptionalList.HasValue()); + } + } +} + +template +void TestDataModelSerialization::NullablesOptionalsEncodeDecodeCheck(nlTestSuite * apSuite, void * apContext) +{ + NullablesOptionalsEncodeDecodeCheck(apSuite, apContext, false, false); + NullablesOptionalsEncodeDecodeCheck(apSuite, apContext, true, false); + NullablesOptionalsEncodeDecodeCheck(apSuite, apContext, false, true); +} + +void TestDataModelSerialization::NullablesOptionalsStruct(nlTestSuite * apSuite, void * apContext) +{ + using EncType = TestCluster::Structs::NullablesAndOptionalsStruct::Type; + using DecType = TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType; + NullablesOptionalsEncodeDecodeCheck(apSuite, apContext); +} + +void TestDataModelSerialization::NullablesOptionalsCommand(nlTestSuite * apSuite, void * apContext) +{ + using EncType = TestCluster::Commands::TestComplexNullableOptionalRequest::Type; + using DecType = TestCluster::Commands::TestComplexNullableOptionalRequest::DecodableType; + NullablesOptionalsEncodeDecodeCheck(apSuite, apContext); +} + int Initialize(void * apSuite) { VerifyOrReturnError(chip::Platform::MemoryInit() == CHIP_NO_ERROR, FAILURE); @@ -873,6 +1120,8 @@ const nlTest sTests[] = NL_TEST_DEF("TestDataModelSerialization_ExtraField", TestDataModelSerialization::TestDataModelSerialization_ExtraField), NL_TEST_DEF("TestDataModelSerialization_InvalidSimpleFieldTypes", TestDataModelSerialization::TestDataModelSerialization_InvalidSimpleFieldTypes), NL_TEST_DEF("TestDataModelSerialization_InvalidListType", TestDataModelSerialization::TestDataModelSerialization_InvalidListType), + NL_TEST_DEF("TestDataModelSerialization_NullablesOptionalsStruct", TestDataModelSerialization::NullablesOptionalsStruct), + NL_TEST_DEF("TestDataModelSerialization_NullablesOptionalsCommand", TestDataModelSerialization::NullablesOptionalsCommand), NL_TEST_SENTINEL() }; // clang-format on diff --git a/src/app/tests/TestEventLogging.cpp b/src/app/tests/TestEventLogging.cpp index 699016e4fa6114..0511a183f56d1b 100644 --- a/src/app/tests/TestEventLogging.cpp +++ b/src/app/tests/TestEventLogging.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -34,16 +35,9 @@ #include #include #include -#include #include #include -#include -#include -#include -#include #include -#include -#include #include @@ -55,49 +49,45 @@ static const chip::ClusterId kLivenessClusterId = 0x00000022; static const uint32_t kLivenessChangeEvent = 1; static const chip::EndpointId kTestEndpointId = 2; static const chip::TLV::Tag kLivenessDeviceStatus = chip::TLV::ContextTag(1); -static chip::TransportMgr gTransportManager; -static chip::System::LayerImpl gSystemLayer; static uint8_t gDebugEventBuffer[128]; static uint8_t gInfoEventBuffer[128]; static uint8_t gCritEventBuffer[128]; static chip::app::CircularEventBuffer gCircularEventBuffer[3]; -chip::SessionManager gSessionManager; -chip::Messaging::ExchangeManager gExchangeManager; -chip::secure_channel::MessageCounterManager gMessageCounterManager; - -void InitializeChip(nlTestSuite * apSuite) +class TestContext : public chip::Test::AppContext { - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Optional peer(chip::Transport::Type::kUndefined); +public: + static int Initialize(void * context) + { + if (AppContext::Initialize(context) != SUCCESS) + return FAILURE; - err = chip::Platform::MemoryInit(); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + auto * ctx = static_cast(context); - gSystemLayer.Init(); + chip::app::LogStorageResources logStorageResources[] = { + { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Debug }, + { &gInfoEventBuffer[0], sizeof(gInfoEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Info }, + { &gCritEventBuffer[0], sizeof(gCritEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Critical }, + }; - err = gSessionManager.Init(&gSystemLayer, &gTransportManager, &gMessageCounterManager); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + chip::app::EventManagement::CreateEventManagement(&ctx->GetExchangeManager(), + sizeof(logStorageResources) / sizeof(logStorageResources[0]), + gCircularEventBuffer, logStorageResources); - err = gExchangeManager.Init(&gSessionManager); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + return SUCCESS; + } - err = gMessageCounterManager.Init(&gExchangeManager); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); -} + static int Finalize(void * context) + { + chip::app::EventManagement::DestroyEventManagement(); -void InitializeEventLogging() -{ - chip::app::LogStorageResources logStorageResources[] = { - { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Debug }, - { &gInfoEventBuffer[0], sizeof(gInfoEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Info }, - { &gCritEventBuffer[0], sizeof(gCritEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Critical }, - }; - - chip::app::EventManagement::CreateEventManagement( - &gExchangeManager, sizeof(logStorageResources) / sizeof(logStorageResources[0]), gCircularEventBuffer, logStorageResources); -} + if (AppContext::Finalize(context) != SUCCESS) + return FAILURE; + + return SUCCESS; + } +}; void SimpleDumpWriter(const char * aFormat, ...) { @@ -293,27 +283,24 @@ static void CheckLogEventWithDiscardLowEvent(nlTestSuite * apSuite, void * apCon const nlTest sTests[] = { NL_TEST_DEF("CheckLogEventWithEvictToNextBuffer", CheckLogEventWithEvictToNextBuffer), NL_TEST_DEF("CheckLogEventWithDiscardLowEvent", CheckLogEventWithDiscardLowEvent), NL_TEST_SENTINEL() }; + +// clang-format off +nlTestSuite sSuite = +{ + "EventLogging", + &sTests[0], + TestContext::Initialize, + TestContext::Finalize +}; +// clang-format on + } // namespace int TestEventLogging() { - // clang-format off - nlTestSuite theSuite = - { - "EventLogging", - &sTests[0], - nullptr, - nullptr - }; - // clang-format on - - InitializeChip(&theSuite); - InitializeEventLogging(); - nlTestRunner(&theSuite, nullptr); - - gSystemLayer.Shutdown(); - - return (nlTestRunnerStats(&theSuite)); + TestContext gContext; + nlTestRunner(&sSuite, &gContext); + return (nlTestRunnerStats(&sSuite)); } CHIP_REGISTER_TEST_SUITE(TestEventLogging) diff --git a/src/app/tests/TestInteractionModelEngine.cpp b/src/app/tests/TestInteractionModelEngine.cpp index ea568a662467d7..b55200f7a901f7 100644 --- a/src/app/tests/TestInteractionModelEngine.cpp +++ b/src/app/tests/TestInteractionModelEngine.cpp @@ -23,6 +23,7 @@ */ #include +#include #include #include #include @@ -30,26 +31,12 @@ #include #include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include #include -namespace { -static chip::System::LayerImpl gSystemLayer; -static chip::SessionManager gSessionManager; -static chip::Messaging::ExchangeManager gExchangeManager; -static chip::secure_channel::MessageCounterManager gMessageCounterManager; -static chip::TransportMgr gTransportManager; -} // namespace +using TestContext = chip::Test::AppContext; namespace chip { namespace app { @@ -75,8 +62,9 @@ int TestInteractionModelEngine::GetClusterInfoListLength(ClusterInfo * apCluster void TestInteractionModelEngine::TestClusterInfoPushRelease(nlTestSuite * apSuite, void * apContext) { - CHIP_ERROR err = CHIP_NO_ERROR; - err = InteractionModelEngine::GetInstance()->Init(&gExchangeManager, nullptr); + TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; + err = InteractionModelEngine::GetInstance()->Init(&ctx.GetExchangeManager(), nullptr); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); ClusterInfo * clusterInfoList = nullptr; ClusterInfo clusterInfo1; @@ -105,8 +93,9 @@ void TestInteractionModelEngine::TestClusterInfoPushRelease(nlTestSuite * apSuit void TestInteractionModelEngine::TestMergeOverlappedAttributePath(nlTestSuite * apSuite, void * apContext) { - CHIP_ERROR err = CHIP_NO_ERROR; - err = InteractionModelEngine::GetInstance()->Init(&gExchangeManager, nullptr); + TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; + err = InteractionModelEngine::GetInstance()->Init(&ctx.GetExchangeManager(), nullptr); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); ClusterInfo clusterInfoList[2]; @@ -131,25 +120,6 @@ void TestInteractionModelEngine::TestMergeOverlappedAttributePath(nlTestSuite * } // namespace chip namespace { -void InitializeChip(nlTestSuite * apSuite) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Optional peer(chip::Transport::Type::kUndefined); - - err = chip::Platform::MemoryInit(); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - - gSystemLayer.Init(); - - err = gSessionManager.Init(&gSystemLayer, &gTransportManager, &gMessageCounterManager); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - - err = gExchangeManager.Init(&gSessionManager); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - - err = gMessageCounterManager.Init(&gExchangeManager); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); -} // clang-format off const nlTest sTests[] = @@ -159,27 +129,24 @@ const nlTest sTests[] = NL_TEST_SENTINEL() }; // clang-format on -} // namespace -int TestInteractionModelEngine() +// clang-format off +nlTestSuite sSuite = { - // clang-format off - nlTestSuite theSuite = - { - "TestInteractionModelEngine", - &sTests[0], - nullptr, - nullptr - }; - // clang-format on - - InitializeChip(&theSuite); - - nlTestRunner(&theSuite, nullptr); + "TestInteractionModelEngine", + &sTests[0], + TestContext::Initialize, + TestContext::Finalize +}; +// clang-format on - gSystemLayer.Shutdown(); +} // namespace - return (nlTestRunnerStats(&theSuite)); +int TestInteractionModelEngine() +{ + TestContext gContext; + nlTestRunner(&sSuite, &gContext); + return (nlTestRunnerStats(&sSuite)); } CHIP_REGISTER_TEST_SUITE(TestInteractionModelEngine) diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index 8032ef8143ae96..7f7352560b7b54 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -33,25 +34,13 @@ #include #include #include -#include #include -#include + #include -#include -#include -#include -#include -#include -#include -#include -#include + #include namespace { -chip::TransportMgrBase gTransportManager; -chip::Test::LoopbackTransport gLoopback; -chip::Test::IOContext gIOContext; -chip::secure_channel::MessageCounterManager gMessageCounterManager; uint8_t gDebugEventBuffer[128]; uint8_t gInfoEventBuffer[128]; uint8_t gCritEventBuffer[128]; @@ -64,20 +53,39 @@ chip::EventId kTestEventIdDebug = 1; chip::EventId kTestEventIdCritical = 2; uint8_t kTestFieldValue1 = 1; chip::TLV::Tag kTestEventTag = chip::TLV::ContextTag(1); -using TestContext = chip::Test::MessagingContext; -TestContext sContext; -void InitializeEventLogging(chip::Messaging::ExchangeManager & aExchangeManager) +class TestContext : public chip::Test::AppContext { - chip::app::LogStorageResources logStorageResources[] = { - { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Debug }, - { &gInfoEventBuffer[0], sizeof(gInfoEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Info }, - { &gCritEventBuffer[0], sizeof(gCritEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Critical }, - }; - - chip::app::EventManagement::CreateEventManagement(&aExchangeManager, ArraySize(logStorageResources), gCircularEventBuffer, - logStorageResources); -} +public: + static int Initialize(void * context) + { + if (AppContext::Initialize(context) != SUCCESS) + return FAILURE; + + auto * ctx = static_cast(context); + + chip::app::LogStorageResources logStorageResources[] = { + { &gDebugEventBuffer[0], sizeof(gDebugEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Debug }, + { &gInfoEventBuffer[0], sizeof(gInfoEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Info }, + { &gCritEventBuffer[0], sizeof(gCritEventBuffer), nullptr, 0, nullptr, chip::app::PriorityLevel::Critical }, + }; + + chip::app::EventManagement::CreateEventManagement(&ctx->GetExchangeManager(), ArraySize(logStorageResources), + gCircularEventBuffer, logStorageResources); + + return SUCCESS; + } + + static int Finalize(void * context) + { + chip::app::EventManagement::DestroyEventManagement(); + + if (AppContext::Finalize(context) != SUCCESS) + return FAILURE; + + return SUCCESS; + } +}; class TestEventGenerator : public chip::app::EventLoggingDelegate { @@ -1125,49 +1133,22 @@ const nlTest sTests[] = }; // clang-format on -int Initialize(void * aContext); -int Finalize(void * aContext); - // clang-format off nlTestSuite sSuite = { - "TestReadInteraction", - &sTests[0], - Initialize, - Finalize + "TestReadInteraction", + &sTests[0], + TestContext::Initialize, + TestContext::Finalize }; // clang-format on -int Initialize(void * aContext) -{ - // Initialize System memory and resources - VerifyOrReturnError(chip::Platform::MemoryInit() == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gIOContext.Init(&sSuite) == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gTransportManager.Init(&gLoopback) == CHIP_NO_ERROR, FAILURE); - - auto * ctx = static_cast(aContext); - VerifyOrReturnError(ctx->Init(&sSuite, &gTransportManager, &gIOContext) == CHIP_NO_ERROR, FAILURE); - - InitializeEventLogging(ctx->GetExchangeManager()); - gTransportManager.SetSessionManager(&ctx->GetSecureSessionManager()); - return SUCCESS; -} - -int Finalize(void * aContext) -{ - CHIP_ERROR err = reinterpret_cast(aContext)->Shutdown(); - gIOContext.Shutdown(); - chip::Platform::MemoryShutdown(); - chip::app::EventManagement::DestroyEventManagement(); - return (err == CHIP_NO_ERROR) ? SUCCESS : FAILURE; -} - } // namespace int TestReadInteraction() { - nlTestRunner(&sSuite, &sContext); - + TestContext gContext; + nlTestRunner(&sSuite, &gContext); return (nlTestRunnerStats(&sSuite)); } diff --git a/src/app/tests/TestReportingEngine.cpp b/src/app/tests/TestReportingEngine.cpp index 3228ddf71114c7..440dc20680a7b8 100644 --- a/src/app/tests/TestReportingEngine.cpp +++ b/src/app/tests/TestReportingEngine.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -32,25 +33,14 @@ #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include +using TestContext = chip::Test::AppContext; + namespace chip { -static System::LayerImpl gSystemLayer; -static SessionManager gSessionManager; -static Messaging::ExchangeManager gExchangeManager; -static TransportMgr gTransportManager; -static secure_channel::MessageCounterManager gMessageCounterManager; + constexpr ClusterId kTestClusterId = 6; constexpr EndpointId kTestEndpointId = 1; constexpr chip::AttributeId kTestFieldId1 = 1; @@ -77,7 +67,8 @@ class TestExchangeDelegate : public Messaging::ExchangeDelegate void TestReportingEngine::TestBuildAndSendSingleReportData(nlTestSuite * apSuite, void * apContext) { - CHIP_ERROR err = CHIP_NO_ERROR; + TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; app::ReadHandler readHandler; System::PacketBufferTLVWriter writer; System::PacketBufferHandle readRequestbuf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); @@ -85,9 +76,9 @@ void TestReportingEngine::TestBuildAndSendSingleReportData(nlTestSuite * apSuite AttributePathList::Builder attributePathListBuilder; AttributePath::Builder attributePathBuilder; - err = InteractionModelEngine::GetInstance()->Init(&gExchangeManager, nullptr); + err = InteractionModelEngine::GetInstance()->Init(&ctx.GetExchangeManager(), nullptr); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - Messaging::ExchangeContext * exchangeCtx = gExchangeManager.NewContext(SessionHandle(0, 0, 0, 0), nullptr); + Messaging::ExchangeContext * exchangeCtx = ctx.GetExchangeManager().NewContext(SessionHandle(0, 0, 0, 0), nullptr); TestExchangeDelegate delegate; exchangeCtx->SetDelegate(&delegate); @@ -120,7 +111,7 @@ void TestReportingEngine::TestBuildAndSendSingleReportData(nlTestSuite * apSuite NL_TEST_ASSERT(apSuite, readRequestBuilder.GetError() == CHIP_NO_ERROR); err = writer.Finalize(&readRequestbuf); NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - readHandler.Init(&gExchangeManager, nullptr, exchangeCtx, chip::app::ReadHandler::InteractionType::Read); + readHandler.Init(&ctx.GetExchangeManager(), nullptr, exchangeCtx, chip::app::ReadHandler::InteractionType::Read); readHandler.OnReadInitialRequest(std::move(readRequestbuf)); err = InteractionModelEngine::GetInstance()->GetReportingEngine().BuildAndSendSingleReportData(&readHandler); NL_TEST_ASSERT(apSuite, err == CHIP_ERROR_NOT_CONNECTED); @@ -131,54 +122,31 @@ void TestReportingEngine::TestBuildAndSendSingleReportData(nlTestSuite * apSuite } // namespace chip namespace { -void InitializeChip(nlTestSuite * apSuite) +// clang-format off +const nlTest sTests[] = { - CHIP_ERROR err = CHIP_NO_ERROR; - chip::Optional peer(chip::Transport::Type::kUndefined); - - err = chip::Platform::MemoryInit(); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - - chip::gSystemLayer.Init(); - - err = chip::gSessionManager.Init(&chip::gSystemLayer, &chip::gTransportManager, &chip::gMessageCounterManager); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - - err = chip::gExchangeManager.Init(&chip::gSessionManager); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); - - err = chip::gMessageCounterManager.Init(&chip::gExchangeManager); - NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); -} + NL_TEST_DEF("CheckBuildAndSendSingleReportData", chip::app::reporting::TestReportingEngine::TestBuildAndSendSingleReportData), + NL_TEST_SENTINEL() +}; +// clang-format on // clang-format off -const nlTest sTests[] = - { - NL_TEST_DEF("CheckBuildAndSendSingleReportData", chip::app::reporting::TestReportingEngine::TestBuildAndSendSingleReportData), - NL_TEST_SENTINEL() - }; +nlTestSuite sSuite = +{ + "TestReportingEngine", + &sTests[0], + TestContext::Initialize, + TestContext::Finalize +}; // clang-format on + } // namespace int TestReportingEngine() { - // clang-format off - nlTestSuite theSuite = - { - "TestReportingEngine", - &sTests[0], - nullptr, - nullptr - }; - // clang-format on - - InitializeChip(&theSuite); - - nlTestRunner(&theSuite, nullptr); - - chip::gSystemLayer.Shutdown(); - - return (nlTestRunnerStats(&theSuite)); + TestContext gContext; + nlTestRunner(&sSuite, &gContext); + return (nlTestRunnerStats(&sSuite)); } CHIP_REGISTER_TEST_SUITE(TestReportingEngine) diff --git a/src/app/tests/TestWriteInteraction.cpp b/src/app/tests/TestWriteInteraction.cpp index 79db04edea0c83..e63647a2effc89 100644 --- a/src/app/tests/TestWriteInteraction.cpp +++ b/src/app/tests/TestWriteInteraction.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -25,31 +26,17 @@ #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +using TestContext = chip::Test::AppContext; + namespace { -chip::TransportMgrBase gTransportManager; -chip::Test::LoopbackTransport gLoopback; -chip::Test::IOContext gIOContext; uint8_t attributeDataTLV[CHIP_CONFIG_DEFAULT_UDP_MTU_SIZE]; size_t attributeDataTLVLen = 0; -using TestContext = chip::Test::MessagingContext; -TestContext sContext; - } // namespace namespace chip { namespace app { @@ -417,47 +404,22 @@ const nlTest sTests[] = }; // clang-format on -int Initialize(void * aContext); -int Finalize(void * aContext); - // clang-format off nlTestSuite sSuite = { "TestWriteInteraction", &sTests[0], - Initialize, - Finalize + TestContext::Initialize, + TestContext::Finalize }; // clang-format on -int Initialize(void * aContext) -{ - // Initialize System memory and resources - VerifyOrReturnError(chip::Platform::MemoryInit() == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gIOContext.Init(&sSuite) == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gTransportManager.Init(&gLoopback) == CHIP_NO_ERROR, FAILURE); - - auto * ctx = static_cast(aContext); - VerifyOrReturnError(ctx->Init(&sSuite, &gTransportManager, &gIOContext) == CHIP_NO_ERROR, FAILURE); - - gTransportManager.SetSessionManager(&ctx->GetSecureSessionManager()); - return SUCCESS; -} - -int Finalize(void * aContext) -{ - CHIP_ERROR err = reinterpret_cast(aContext)->Shutdown(); - gIOContext.Shutdown(); - chip::Platform::MemoryShutdown(); - return (err == CHIP_NO_ERROR) ? SUCCESS : FAILURE; -} - } // namespace int TestWriteInteraction() { - nlTestRunner(&sSuite, &sContext); - + TestContext gContext; + nlTestRunner(&sSuite, &gContext); return (nlTestRunnerStats(&sSuite)); } diff --git a/src/app/tests/integration/chip_im_initiator.cpp b/src/app/tests/integration/chip_im_initiator.cpp index 247b294100f206..61d7e209f85241 100644 --- a/src/app/tests/integration/chip_im_initiator.cpp +++ b/src/app/tests/integration/chip_im_initiator.cpp @@ -429,7 +429,7 @@ CHIP_ERROR EstablishSecureSession() // Attempt to connect to the peer. err = gSessionManager.NewPairing(chip::Optional::Value( - chip::Transport::PeerAddress::UDP(gDestAddr, CHIP_PORT, INET_NULL_INTERFACEID)), + chip::Transport::PeerAddress::UDP(gDestAddr, CHIP_PORT, chip::Inet::InterfaceId::Null())), chip::kTestDeviceNodeId, testSecurePairingSecret, chip::CryptoContext::SessionRole::kInitiator, gFabricIndex); diff --git a/src/app/tests/suites/TestClusterComplexTypes.yaml b/src/app/tests/suites/TestClusterComplexTypes.yaml index 4155a85e88d1a0..577fc1fa1fde6c 100644 --- a/src/app/tests/suites/TestClusterComplexTypes.yaml +++ b/src/app/tests/suites/TestClusterComplexTypes.yaml @@ -390,3 +390,41 @@ tests: ] response: error: 1 + + # Tests for Nullables and Optionals + + - label: "Send Test Command with optional arg set." + command: "testNullableOptionalRequest" + arguments: + values: + - name: "arg1" + value: 5 + response: + values: + - name: "wasPresent" + value: true + - name: "wasNull" + value: false + - name: "value" + value: 5 + + - label: "Send Test Command without its optional arg." + command: "testNullableOptionalRequest" + response: + values: + - name: "wasPresent" + value: false + + - label: "Send Test Command with optional arg set to null." + disabled: true + command: "testNullableOptionalRequest" + arguments: + values: + - name: "arg1" + value: null + response: + values: + - name: "wasPresent" + value: true + - name: "wasNull" + value: false diff --git a/src/app/tests/suites/TestIdentifyCluster.yaml b/src/app/tests/suites/TestIdentifyCluster.yaml new file mode 100644 index 00000000000000..883cd7fb6794a6 --- /dev/null +++ b/src/app/tests/suites/TestIdentifyCluster.yaml @@ -0,0 +1,27 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Identify Cluster Tests + +config: + cluster: "Identify" + endpoint: 0 + +tests: + - label: "Send Identify command and expect success response" + command: "identify" + arguments: + values: + - name: "IdentifyTime" + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml b/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml index 27dbbc51db65ce..89fe838951588c 100644 --- a/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml @@ -21,21 +21,21 @@ config: tests: - label: "read the mandatory attribute: MeasuredValue" command: "readAttribute" - attribute: "measured value" + attribute: "MeasuredValue" response: constraints: type: uint16 - label: "read the mandatory attribute: MinMeasuredValue" command: "readAttribute" - attribute: "min measured value" + attribute: "MinMeasuredValue" response: constraints: type: uint16 - label: "read the mandatory attribute: MaxMeasuredValue" command: "readAttribute" - attribute: "max measured value" + attribute: "MaxMeasuredValue" response: constraints: type: uint16 @@ -43,7 +43,7 @@ tests: - label: "write the default value to optional attribute: MeasuredValue" disabled: true command: "writeAttribute" - attribute: "measured value" + attribute: "MeasuredValue" arguments: value: 0 response: @@ -51,7 +51,7 @@ tests: - label: "write the default value to optional attribute: MinMeasuredValue" command: "writeAttribute" - attribute: "min measured value" + attribute: "MinMeasuredValue" arguments: value: 0 response: @@ -59,7 +59,7 @@ tests: - label: "write the default value to optional attribute: MaxMeasuredValue" command: "writeAttribute" - attribute: "max measured value" + attribute: "MaxMeasuredValue" arguments: value: 0 response: @@ -67,21 +67,21 @@ tests: - label: "read the mandatory attribute: MeasuredValue" command: "readAttribute" - attribute: "measured value" + attribute: "MeasuredValue" response: constraints: type: uint16 - label: "read the mandatory attribute: MinMeasuredValue" command: "readAttribute" - attribute: "min measured value" + attribute: "MinMeasuredValue" response: constraints: type: uint16 - label: "read the mandatory attribute: MaxMeasuredValue" command: "readAttribute" - attribute: "max measured value" + attribute: "MaxMeasuredValue" response: constraints: type: uint16 diff --git a/src/app/tests/suites/certification/Test_TC_FLW_2_2.yaml b/src/app/tests/suites/certification/Test_TC_FLW_2_2.yaml index 35f5413cfad104..2eac222866cb64 100644 --- a/src/app/tests/suites/certification/Test_TC_FLW_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_FLW_2_2.yaml @@ -21,7 +21,7 @@ config: tests: - label: "read the mandatory attribute: MeasuredValue" command: "readAttribute" - attribute: "measured value" + attribute: "MeasuredValue" response: constraints: type: uint16 @@ -31,7 +31,7 @@ tests: - label: "read the mandatory attribute: MeasuredValue" command: "readAttribute" - attribute: "measured value" + attribute: "MeasuredValue" response: constraints: type: uint16 diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_10.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_10.yaml new file mode 100644 index 00000000000000..5bfdfd6c36e9bf --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_3_10.yaml @@ -0,0 +1,29 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 21.5.3. [TC-MC-3.10] Show and Hide Input Status Verification + +config: + cluster: "Media Input" + endpoint: 1 + +tests: + # TDOD: Enable when SDK supports command + - label: "Hide Input Status Command" + disabled: true + command: "HideInputStatus" + # TDOD: Enable when SDK supports command + - label: "Show Input Status Command" + disabled: true + command: "ShowInputStatus" diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_11.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_11.yaml new file mode 100644 index 00000000000000..485a6557f974c6 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_3_11.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 21.5.4. [TC-MC-3.11] Rename Input Verification + +config: + cluster: "Media Input" + endpoint: 1 + +tests: + # Remove disable flag when SDK supports command. + - label: "Rename Input Command" + disabled: true + command: "RenameInput" + arguments: + values: + - name: "index" + value: 1 + - name: "name" + value: "A1" + # Remove disable flag when SDK supports command. + - label: "Rename Input Command" + disabled: true + command: "RenameInput" + arguments: + values: + - name: "index" + value: 1 + - name: "name" + value: "A2" + # Remove disable flag when SDK supports command. + - label: "Read attribute media input list" + disabled: true + command: "readAttribute" + attribute: "media input list" + response: + value: [] diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_6.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_6.yaml new file mode 100644 index 00000000000000..48542c9e424273 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_3_6.yaml @@ -0,0 +1,70 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 21.4.2. [TC-MC-3.6] Current App Verification + +config: + cluster: "Application Launcher" + endpoint: 1 + +tests: + # TODO: Update the corresponding values when feature is supported + - label: "Launch an app with the provided a application ID" + disabled: true + command: "LaunchApp" + arguments: + values: + - name: "data" + value: "Hello World" + - name: "catalogVendorId" + value: 1234 + - name: "applicationId" + value: "HelloWorldApp" + + # TODO: Update response value to correspond with catalog vendor ID + - label: "Read Current catalog vendor id attribute." + disabled: true + command: "readAttribute" + attribute: "catalog vendor id" + response: + value: 1234 + constraints: + type: uint16 + + # TODO: Update response value to correspond with application ID + - label: "Read Current App ID attribute." + disabled: true + command: "readAttribute" + attribute: "application id" + response: + value: "HelloWorldApp" + constraints: + type: string + + # TODO: Update the corresponding values when feature is supported + - label: "Stop an app with the provided application ID" + disabled: true + command: "StopApp" + arguments: + values: + - name: "applicationId" + value: "HelloWorldApp" + + # TODO: Update response value to correspond with application ID + - label: "Read Current App ID attribute." + disabled: true + command: "readAttribute" + attribute: "application id" + response: + value: null diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_7.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_7.yaml new file mode 100644 index 00000000000000..310ac4cce8284d --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_3_7.yaml @@ -0,0 +1,85 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 21.4.2. [TC-MC-3.6] Current App Verification + +config: + cluster: "Application Launcher" + endpoint: 1 + +tests: + # TODO: Update the corresponding values when feature is supported + - label: "Launch an app with the provided a application ID" + disabled: true + command: "LaunchApp" + arguments: + values: + - name: "data" + value: "Hello World" + - name: "catalogVendorId" + value: 1234 + - name: "applicationId" + value: "HelloWorldApp" + + # TODO: Update the corresponding values when feature is supported + - label: "Stop an app with the provided application ID" + disabled: true + command: "StopApp" + arguments: + values: + - name: "applicationId" + value: "HelloWorldApp" + + # TODO: Update the corresponding values when feature is supported + - label: "Launch an app with the provided a application ID" + disabled: true + command: "LaunchApp" + arguments: + values: + - name: "data" + value: "Hello World" + - name: "catalogVendorId" + value: 1234 + - name: "applicationId" + value: "NonAvailableApp" + response: + error: 1 + + # TODO: Update the corresponding values when feature is supported + - label: "Launch an app with the provided a application ID" + disabled: true + command: "LaunchApp" + arguments: + values: + - name: "data" + value: "Hello World" + - name: "catalogVendorId" + value: 1234 + - name: "applicationId" + value: "HelloWorldApp" + + # TODO: Update the corresponding values when feature is supported + - label: "Launch an app with the provided a application ID" + disabled: true + command: "LaunchApp" + arguments: + values: + - name: "data" + value: "Hello World" + - name: "catalogVendorId" + value: 1234 + - name: "applicationId" + value: "HelloWorldApp2" + response: + error: 2 diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_8.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_8.yaml new file mode 100644 index 00000000000000..09a29a5bceff69 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_3_8.yaml @@ -0,0 +1,28 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 21.5.1. [TC-MC-3.8] Input List Verification + +config: + cluster: "Media Input" + endpoint: 1 + +tests: + # TODO: Enable test and update response value when SDK supports. + - label: "Read attribute media input list" + disabled: true + command: "readAttribute" + attribute: "media input list" + response: + value: [] diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_9.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_9.yaml new file mode 100644 index 00000000000000..2b287b78c8ac80 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_3_9.yaml @@ -0,0 +1,36 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 21.5.2. [TC-MC-3.9] Select Input Verification + +config: + cluster: "Media Input" + endpoint: 1 + +tests: + # Remove disable flag when SDK supports command. + - label: "Select Input Command" + disabled: true + command: "SelectInput" + arguments: + values: + - name: "index" + value: 1 + # Remove disable flag when SDK supports attribute. + - label: "Read current input list" + disabled: true + command: "readAttribute" + attribute: "current media input" + response: + value: 1 diff --git a/src/app/tests/suites/certification/Test_TC_OCC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OCC_2_1.yaml new file mode 100644 index 00000000000000..8bf1a7583ac679 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_OCC_2_1.yaml @@ -0,0 +1,115 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 30.2.1. [TC-OCC-2.1] Attributes with server as DUT + +config: + cluster: "Occupancy Sensing" + endpoint: 1 + +tests: + - label: "Reads mandatory attribute: Occupancy" + disabled: true + command: "readAttribute" + attribute: "occupancy" + response: + value: 0 + + - label: "Reads mandatory attribute constrains: Occupancy" + command: "readAttribute" + attribute: "occupancy" + response: + constraints: + type: map8 + minValue: 0 + maxValue: 1 + + - label: + "Writes the respective default value to mandatory attribute: Occupancy" + command: "writeAttribute" + attribute: "occupancy" + arguments: + value: 0 + response: + error: 1 + + - label: "Reads back mandatory attribute: Occupancy" + command: "readAttribute" + attribute: "occupancy" + response: + value: 0 + + - label: "Reads mandatory attribute: OccupancySensorType" + disabled: true + command: "readAttribute" + attribute: "occupancy sensor type" + response: + value: 0 + + - label: "Reads mandatory attribute constrains: OccupancySensorType" + command: "readAttribute" + attribute: "occupancy sensor type" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 3 + + - label: + "Writes the respective default value to mandatory attribute: + OccupancySensorType" + command: "writeAttribute" + attribute: "occupancy sensor type" + arguments: + value: 0 + response: + error: 1 + + - label: "Reads back mandatory attribute: OccupancySensorType" + command: "readAttribute" + attribute: "occupancy sensor type" + response: + value: 0 + + - label: "Reads mandatory attribute: OccupancySensorTypeBitmap" + disabled: true + command: "readAttribute" + attribute: "occupancy sensor type bitmap" + response: + value: 0 + + - label: "Reads mandatory attribute constrains: OccupancySensorTypeBitmap" + command: "readAttribute" + attribute: "occupancy sensor type bitmap" + response: + constraints: + type: map8 + minValue: 1 + maxValue: 7 + + - label: + "Writes the respective default value to mandatory attribute: + OccupancySensorTypeBitmap" + command: "writeAttribute" + attribute: "occupancy sensor type bitmap" + arguments: + value: 1 + response: + error: 1 + + - label: "Reads back mandatory attribute: OccupancySensorTypeBitmap" + command: "readAttribute" + attribute: "occupancy sensor type bitmap" + response: + value: 1 diff --git a/src/app/tests/suites/certification/Test_TC_PCC_2_2.yaml b/src/app/tests/suites/certification/Test_TC_PCC_2_2.yaml new file mode 100644 index 00000000000000..a36a2319fb884b --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PCC_2_2.yaml @@ -0,0 +1,59 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 15.2.2. [TC-PCC-2.2] Primary functionality with server as DUT + +config: + cluster: "Pump Configuration and Control" + endpoint: 1 + +tests: + - label: "Write 1 to the OperationMode attribute to DUT: OperationMode" + command: "writeAttribute" + attribute: "OperationMode" + arguments: + value: 1 + + - label: "Reads the attribute: EffectiveOperationMode" + disabled: true + command: "readAttribute" + attribute: "EffectiveOperationMode" + response: + value: 1 + + - label: "Write 2 to the OperationMode attribute to DUT: OperationMode" + command: "writeAttribute" + attribute: "OperationMode" + arguments: + value: 2 + + - label: "Reads the attribute: EffectiveOperationMode" + disabled: true + command: "readAttribute" + attribute: "EffectiveOperationMode" + response: + value: 2 + + - label: "Write 3 to the OperationMode attribute to DUT: OperationMode" + command: "writeAttribute" + attribute: "OperationMode" + arguments: + value: 3 + + - label: "Reads the attribute: EffectiveOperationMode" + disabled: true + command: "readAttribute" + attribute: "EffectiveOperationMode" + response: + value: 3 diff --git a/src/app/tests/suites/certification/Test_TC_PCC_2_3.yaml b/src/app/tests/suites/certification/Test_TC_PCC_2_3.yaml new file mode 100644 index 00000000000000..7d1da7c169ebab --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_PCC_2_3.yaml @@ -0,0 +1,116 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 15.2.3. [TC-PCC-2.3] Primary functionality with server as DUT + +config: + cluster: "Pump Configuration and Control" + endpoint: 1 + +tests: + - label: "Write 0 to the OperationMode attribute to DUT" + command: "writeAttribute" + attribute: "OperationMode" + arguments: + value: 0 + + - label: "Reads the attribute: EffectiveOperationMode" + command: "readAttribute" + attribute: "EffectiveOperationMode" + response: + value: 0 + + - label: "Write 0 to the ControlMode attribute to DUT" + disabled: true + command: "writeAttribute" + attribute: "ControlMode" + arguments: + value: 0 + + - label: "Reads the attribute: EffectiveControlMode" + disabled: true + command: "readAttribute" + attribute: "EffectiveControlMode" + response: + value: 0 + + - label: "Write 1 to the ControlMode attribute to DUT" + disabled: true + command: "writeAttribute" + attribute: "ControlMode" + arguments: + value: 1 + + - label: "Reads the attribute: EffectiveControlMode" + disabled: true + command: "readAttribute" + attribute: "EffectiveControlMode" + response: + value: 1 + + - label: "Write 2 to the ControlMode attribute to DUT" + disabled: true + command: "writeAttribute" + attribute: "ControlMode" + arguments: + value: 2 + + - label: "Reads the attribute: EffectiveControlMode" + disabled: true + command: "readAttribute" + attribute: "EffectiveControlMode" + response: + value: 2 + + - label: "Write 3 to the ControlMode attribute to DUT" + disabled: true + command: "writeAttribute" + attribute: "ControlMode" + arguments: + value: 3 + + - label: "Reads the attribute: EffectiveControlMode" + disabled: true + command: "readAttribute" + attribute: "EffectiveControlMode" + response: + value: 3 + + - label: "Write 5 to the ControlMode attribute to DUT" + disabled: true + command: "writeAttribute" + attribute: "ControlMode" + arguments: + value: 5 + + - label: "Reads the attribute: EffectiveControlMode" + disabled: true + command: "readAttribute" + attribute: "EffectiveControlMode" + response: + value: 5 + + - label: "Write 7 to the ControlMode attribute to DUT" + disabled: true + command: "writeAttribute" + attribute: "ControlMode" + arguments: + value: 7 + + - label: "Reads the attribute: EffectiveControlMode" + disabled: true + command: "readAttribute" + attribute: "EffectiveControlMode" + response: + value: 7 diff --git a/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml b/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml new file mode 100644 index 00000000000000..1ccf2d58cba84a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml @@ -0,0 +1,84 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 9.2.1. [TC-RH-2.1] Attributes with server as DUT + +config: + cluster: "Relative Humidity Measurement" + endpoint: 1 + +tests: + - label: "Reads the mandatory attribute: MeasuredValue" + disabled: true + command: "readAttribute" + attribute: "measured value" + response: + value: 65535 + + - label: "Reads constraints of attribute: MeasuredValue" + command: "readAttribute" + attribute: "measured value" + response: + constraints: + type: uint16 + + - label: "Reads the mandatory attribute: MinMeasuredValue" + disabled: true + command: "readAttribute" + attribute: "min measured value" + response: + value: 65535 + + - label: "Reads constraints of attribute: MinMeasuredValue" + command: "readAttribute" + attribute: "min measured value" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 9999 + + - label: "Reads the mandatory attribute: MaxMeasuredValue" + disabled: true + command: "readAttribute" + attribute: "max measured value" + response: + value: 65535 + + - label: "Reads constraints of attribute: MaxMeasuredValue" + disabled: true + command: "readAttribute" + attribute: "max measured value" + response: + constraints: + type: uint16 + minValue: 1 + maxValue: 10000 + + - label: "Reads the optional attribute: Tolerance" + disabled: true + command: "readAttribute" + attribute: "tolerance" + response: + value: 0 + + - label: "Reads constraints of attribute: Tolerance" + disabled: true + command: "readAttribute" + attribute: "tolerance" + response: + constraints: + type: uint16 + minValue: 0 + maxValue: 2048 diff --git a/src/app/tests/suites/certification/Test_TC_TM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TM_2_1.yaml index a6e0f4f172f848..a6baa4720263b3 100644 --- a/src/app/tests/suites/certification/Test_TC_TM_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TM_2_1.yaml @@ -21,7 +21,7 @@ config: tests: - label: "read the mandatory attribute: MeasuredValue" command: "readAttribute" - attribute: "measured value" + attribute: "MeasuredValue" response: constraints: type: int16 @@ -29,7 +29,7 @@ tests: - label: "read the mandatory attribute: MinMeasuredValue" disabled: true command: "readAttribute" - attribute: "min measured value" + attribute: "MinMeasuredValue" response: constraints: type: int16 @@ -39,7 +39,7 @@ tests: - label: "read the mandatory attribute: MaxMeasuredValue" disabled: true command: "readAttribute" - attribute: "max measured value" + attribute: "MaxMeasuredValue" response: constraints: type: int16 diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_1_1.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_1_1.yaml index ac148003e84936..2782edb38b5891 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_1_1.yaml @@ -41,8 +41,7 @@ tests: response: value: 5 - - label: "read the optional global attribute: FeatureMap" - disabled: 1 + - label: "read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" response: @@ -53,12 +52,11 @@ tests: command: "writeAttribute" attribute: "FeatureMap" arguments: - value: 0 + value: 5 response: error: 1 - - label: "reads back optional global attribute: FeatureMap" - disabled: true + - label: "reads back global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" response: diff --git a/src/app/zap-templates/common/ClusterTestGeneration.js b/src/app/zap-templates/common/ClusterTestGeneration.js index a49f9484d53f81..de8b509440299a 100644 --- a/src/app/zap-templates/common/ClusterTestGeneration.js +++ b/src/app/zap-templates/common/ClusterTestGeneration.js @@ -396,6 +396,9 @@ function chip_tests_item_parameters(options) const expected = commandValues.find(value => value.name.toLowerCase() == commandArg.name.toLowerCase()); if (!expected) { + if (commandArg.isOptional) { + return undefined; + } printErrorAndExit(this, 'Missing "' + commandArg.name + '" in arguments list: \n\t* ' + commandValues.map(command => command.name).join('\n\t* ')); @@ -438,7 +441,7 @@ function chip_tests_item_parameters(options) return commandArg; }); - return commands; + return commands.filter(item => item !== undefined); }); return asBlocks.call(this, promise, options); diff --git a/src/app/zap-templates/common/attributes/Accessors.js b/src/app/zap-templates/common/attributes/Accessors.js index 00ee061aaa0cfe..84433c7abb5a84 100644 --- a/src/app/zap-templates/common/attributes/Accessors.js +++ b/src/app/zap-templates/common/attributes/Accessors.js @@ -31,10 +31,6 @@ function isUnsupportedType(type) function canHaveSimpleAccessors(type) { - if (StringHelper.isString(type)) { - return false; - } - if (ListHelper.isList(type)) { return false; } diff --git a/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt b/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt index 694a972b93832c..644b35310bc529 100644 --- a/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt +++ b/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt @@ -28,14 +28,34 @@ namespace Attributes { {{#if (canHaveSimpleAccessors type)}} namespace {{asUpperCamelCase label}} { -EmberAfStatus Get(chip::EndpointId endpoint, {{asUnderlyingZclType type}} * {{asLowerCamelCase label}}) -{ - return emberAfReadServerAttribute(endpoint, Clusters::{{asUpperCamelCase parent.label}}::Id, Id, (uint8_t *) {{asLowerCamelCase label}}, sizeof(*{{asLowerCamelCase label}})); +{{#*inline "clusterId"}}Clusters::{{asUpperCamelCase parent.label}}::Id{{/inline}} +{{#*inline "sizingBytes"}}{{#if (isShortString type)}}1{{else}}2{{/if}}{{/inline}} +EmberAfStatus Get(chip::EndpointId endpoint, {{#if (isCharString type)}}chip::MutableCharSpan{{else if (isOctetString type)}}chip::MutableByteSpan{{else}}{{asUnderlyingZclType type}} *{{/if}} value) +{ + {{#if (isString type)}} + VerifyOrReturnError(value.size() == {{maxLength}}, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[{{maxLength}} + {{>sizingBytes}}]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, {{>clusterId}}, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[{{>sizingBytes}}], {{maxLength}}); + value.reduce_size(emberAf{{#if (isLongString type)}}Long{{/if}}StringLength(zclString)); + return status; + {{else}} + return emberAfReadServerAttribute(endpoint, {{>clusterId}}, Id, (uint8_t *) value, sizeof(*value)); + {{/if}} } -EmberAfStatus Set(chip::EndpointId endpoint, {{asUnderlyingZclType type}} {{asLowerCamelCase label}}) +EmberAfStatus Set(chip::EndpointId endpoint, {{asUnderlyingZclType type}} value) { - return emberAfWriteServerAttribute(endpoint, Clusters::{{asUpperCamelCase parent.label}}::Id, Id, (uint8_t *) &{{asLowerCamelCase label}}, ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); + {{#if (isString type)}} + VerifyOrReturnError(value.size() <= {{maxLength}}, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[{{maxLength}} + {{>sizingBytes}}]; + emberAfCopyInt{{#if (isShortString type)}}8{{else}}16{{/if}}u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[{{>sizingBytes}}], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, zclString, ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); + {{else}} + return emberAfWriteServerAttribute(endpoint, {{>clusterId}}, Id, (uint8_t *) &value, ZCL_{{asDelimitedMacro type}}_ATTRIBUTE_TYPE); + {{/if}} } } // namespace {{asUpperCamelCase label}} diff --git a/src/app/zap-templates/templates/app/attributes/Accessors.zapt b/src/app/zap-templates/templates/app/attributes/Accessors.zapt index 804731f6a1261d..232f77fad1c884 100644 --- a/src/app/zap-templates/templates/app/attributes/Accessors.zapt +++ b/src/app/zap-templates/templates/app/attributes/Accessors.zapt @@ -25,8 +25,8 @@ namespace Attributes { {{#if clusterRef}} {{#if (canHaveSimpleAccessors type)}} namespace {{asUpperCamelCase label}} { -EmberAfStatus Get(chip::EndpointId endpoint, {{asUnderlyingZclType type}} * {{asLowerCamelCase label}}); // {{type}} {{isArray}} -EmberAfStatus Set(chip::EndpointId endpoint, {{asUnderlyingZclType type}} {{asLowerCamelCase label}}); +EmberAfStatus Get(chip::EndpointId endpoint, {{#if (isCharString type)}}chip::MutableCharSpan{{else if (isOctetString type)}}chip::MutableByteSpan{{else}}{{asUnderlyingZclType type}} *{{/if}} value); // {{type}} {{isArray}} +EmberAfStatus Set(chip::EndpointId endpoint, {{asUnderlyingZclType type}} value); } // namespace {{asUpperCamelCase label}} {{/if}} diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt index 3a3aa52c7fcc41..da04ad670fc1e0 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -102,8 +102,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return {{asUpperCamelCase name}}::Id; } - static constexpr ClusterId GetClusterId() { return {{asUpperCamelCase parent.name}}::Id; } + static constexpr CommandId GetCommandId() { return Commands::{{asUpperCamelCase name}}::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::{{asUpperCamelCase parent.name}}::Id; } {{#zcl_command_arguments}} {{zapTypeToEncodableClusterObjectType type}} {{asLowerCamelCase label}}; @@ -114,8 +114,8 @@ public: struct DecodableType { public: - static constexpr CommandId GetCommandId() { return {{asUpperCamelCase name}}::Id; } - static constexpr ClusterId GetClusterId() { return {{asUpperCamelCase parent.name}}::Id; } + static constexpr CommandId GetCommandId() { return Commands::{{asUpperCamelCase name}}::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::{{asUpperCamelCase parent.name}}::Id; } {{#zcl_command_arguments}} {{zapTypeToDecodableClusterObjectType type}} {{asLowerCamelCase label}}; @@ -134,12 +134,14 @@ namespace Attributes { {{/first}} namespace {{asUpperCamelCase label}} { struct TypeInfo { + {{! forceNotOptional=true because the optionality is on the attribute + itself, but we want just the type of the attribute. }} {{#if entryType}} - using Type = {{zapTypeToEncodableClusterObjectType entryType}}; - using DecodableType = {{zapTypeToDecodableClusterObjectType entryType}}; + using Type = {{zapTypeToEncodableClusterObjectType entryType forceNotOptional=true}}; + using DecodableType = {{zapTypeToDecodableClusterObjectType entryType forceNotOptional=true}}; {{else}} - using Type = {{zapTypeToEncodableClusterObjectType type}}; - using DecodableType = {{zapTypeToDecodableClusterObjectType type}}; + using Type = {{zapTypeToEncodableClusterObjectType type forceNotOptional=true}}; + using DecodableType = {{zapTypeToDecodableClusterObjectType type forceNotOptional=true}}; {{/if}} static constexpr ClusterId GetClusterId() { return Clusters::{{asUpperCamelCase parent.name}}::Id; } @@ -169,7 +171,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::{{asUpperCamelCase priority}}; static constexpr EventId eventId = {{asMEI manufacturerCode code}}; - static constexpr ClusterId GetClusterId() { return {{asUpperCamelCase parent.name}}::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::{{asUpperCamelCase parent.name}}::Id; } {{#zcl_event_fields}} {{zapTypeToEncodableClusterObjectType type}} {{asLowerCamelCase name}}; @@ -182,7 +184,7 @@ struct DecodableType { public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return {{asUpperCamelCase parent.name}}::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::{{asUpperCamelCase parent.name}}::Id; } {{#zcl_event_fields}} {{zapTypeToDecodableClusterObjectType type}} {{asLowerCamelCase name}}; diff --git a/src/app/zap-templates/templates/app/helper.js b/src/app/zap-templates/templates/app/helper.js index 4e751e771cdabc..a7f66d00b27d0b 100644 --- a/src/app/zap-templates/templates/app/helper.js +++ b/src/app/zap-templates/templates/app/helper.js @@ -381,6 +381,20 @@ async function zapTypeToClusterObjectType(type, isDecodable, options) let listNamespace = options.hash.ns ? "chip::app::" : "" promise = promise.then(typeStr => `${listNamespace}DataModel::${listType}<${typeStr}>`); } + if (this.isNullable && !options.hash.forceNotNullable) { + passByReference = true; + // If we did not have a namespace provided, we can assume we're inside + // chip::app::. + let ns = options.hash.ns ? "chip::app::" : "" + promise = promise.then(typeStr => `${ns}DataModel::Nullable<${typeStr}>`); + } + if (this.isOptional && !options.hash.forceNotOptional) { + passByReference = true; + // If we did not have a namespace provided, we can assume we're inside + // chip::. + let ns = options.hash.ns ? "chip::" : "" + promise = promise.then(typeStr => `${ns}Optional<${typeStr}>`); + } if (options.hash.isArgument && passByReference) { promise = promise.then(typeStr => `const ${typeStr} &`); } diff --git a/src/app/zap-templates/zcl/data-model/chip/flow-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/flow-measurement-cluster.xml index 0844e9cd5998f6..38e072dc953d95 100644 --- a/src/app/zap-templates/zcl/data-model/chip/flow-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/flow-measurement-cluster.xml @@ -24,10 +24,10 @@ limitations under the License. FLOW_MEASUREMENT_CLUSTER true true - measured value - min measured value - max measured value - tolerance + MeasuredValue + MinMeasuredValue + MaxMeasuredValue + Tolerance diff --git a/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml index 7c2ab0893680be..d7c5a4c7d6d84c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/temperature-measurement-cluster.xml @@ -24,9 +24,9 @@ limitations under the License. TEMP_MEASUREMENT_CLUSTER true true - measured value - min measured value - max measured value - tolerance + MeasuredValue + MinMeasuredValue + MaxMeasuredValue + Tolerance diff --git a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml index 4696d6b25783ae..4e5abf22ee027c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml @@ -70,6 +70,27 @@ limitations under the License. + + + + + + + + + + + + + + + + + CHIP Test Cluster @@ -260,6 +281,42 @@ limitations under the License. + + + Command that takes an argument which is nullable and optional. The + response returns a boolean indicating whether the argument was present, + if that's true a boolean indicating whether the argument was null, and + if that' false the argument it received. + + + + + + + Command that takes various arguments which can be nullable and/or optional. The + response returns information about which things were received and what + their state was. + + + + + + + + + + + + + + + Simple response for TestWithResponse with a simple return value @@ -308,6 +365,52 @@ limitations under the License. + + + Delivers information about the argument TestNullableOptionalRequest had. + + + + + + + + + Delivers information about the arguments TestComplexNullableOptionalRequest had. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Example test event diff --git a/src/app/zap-templates/zcl/data-model/chip/window-covering.xml b/src/app/zap-templates/zcl/data-model/chip/window-covering.xml index 2b629a50ddb050..88114ef77ce99b 100644 --- a/src/app/zap-templates/zcl/data-model/chip/window-covering.xml +++ b/src/app/zap-templates/zcl/data-model/chip/window-covering.xml @@ -21,7 +21,18 @@ limitations under the License. WINDOW_COVERING_CLUSTER true true - + + + true + false + false + false + Type @@ -86,7 +97,6 @@ limitations under the License. - @@ -101,7 +111,6 @@ limitations under the License. - @@ -171,4 +180,4 @@ limitations under the License. - \ No newline at end of file + diff --git a/src/controller/CHIPDevice.cpp b/src/controller/CHIPDevice.cpp index 7cc1a449ed1fea..a3f345f7083841 100644 --- a/src/controller/CHIPDevice.cpp +++ b/src/controller/CHIPDevice.cpp @@ -142,8 +142,8 @@ CHIP_ERROR Device::Serialize(SerializedDevice & output) serializable.mDeviceTransport = to_underlying(mDeviceAddress.GetTransportType()); - ReturnErrorOnFailure(Inet::GetInterfaceName(mDeviceAddress.GetInterface(), Uint8::to_char(serializable.mInterfaceName), - sizeof(serializable.mInterfaceName))); + ReturnErrorOnFailure(mDeviceAddress.GetInterface().GetInterfaceName(Uint8::to_char(serializable.mInterfaceName), + sizeof(serializable.mInterfaceName))); static_assert(sizeof(serializable.mDeviceAddr) <= INET6_ADDRSTRLEN, "Size of device address must fit within INET6_ADDRSTRLEN"); mDeviceAddress.GetIPAddress().ToString(Uint8::to_char(serializable.mDeviceAddr), sizeof(serializable.mDeviceAddr)); @@ -202,13 +202,13 @@ CHIP_ERROR Device::Deserialize(const SerializedDevice & input) // The InterfaceNameToId() API requires initialization of mInterface, and lock/unlock of // LwIP stack. - Inet::InterfaceId interfaceId = INET_NULL_INTERFACEID; + Inet::InterfaceId interfaceId; if (serializable.mInterfaceName[0] != '\0') { #if CHIP_SYSTEM_CONFIG_USE_LWIP LOCK_TCPIP_CORE(); #endif - CHIP_ERROR inetErr = Inet::InterfaceNameToId(Uint8::to_const_char(serializable.mInterfaceName), interfaceId); + CHIP_ERROR inetErr = Inet::InterfaceId::InterfaceNameToId(Uint8::to_const_char(serializable.mInterfaceName), interfaceId); #if CHIP_SYSTEM_CONFIG_USE_LWIP UNLOCK_TCPIP_CORE(); #endif @@ -308,11 +308,29 @@ void Device::OnResponseTimeout(Messaging::ExchangeContext * ec) {} void Device::OnOpenPairingWindowSuccessResponse(void * context) { ChipLogProgress(Controller, "Successfully opened pairing window on the device"); + Device * device = reinterpret_cast(context); + if (device->mCommissioningWindowCallback != nullptr) + { + device->mCommissioningWindowCallback->mCall(device->mCommissioningWindowCallback->mContext, device->GetDeviceId(), + CHIP_NO_ERROR, device->mSetupPayload); + } } void Device::OnOpenPairingWindowFailureResponse(void * context, uint8_t status) { ChipLogError(Controller, "Failed to open pairing window on the device. Status %d", status); + Device * device = reinterpret_cast(context); + if (device->mCommissioningWindowCallback != nullptr) + { + CHIP_ERROR error = CHIP_ERROR_INVALID_PASE_PARAMETER; + // TODO - Use cluster enum chip::app::Clusters::AdministratorCommissioning::StatusCode::kBusy + if (status == 1) + { + error = CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS; + } + device->mCommissioningWindowCallback->mCall(device->mCommissioningWindowCallback->mContext, device->GetDeviceId(), error, + SetupPayload()); + } } CHIP_ERROR Device::ComputePASEVerifier(uint32_t iterations, uint32_t setupPincode, const ByteSpan & salt, @@ -325,7 +343,8 @@ CHIP_ERROR Device::ComputePASEVerifier(uint32_t iterations, uint32_t setupPincod } CHIP_ERROR Device::OpenCommissioningWindow(uint16_t timeout, uint32_t iteration, CommissioningWindowOption option, - const ByteSpan & salt, SetupPayload & setupPayload) + const ByteSpan & salt, Callback::Callback * callback, + SetupPayload & setupPayload) { constexpr EndpointId kAdministratorCommissioningClusterEndpoint = 0; @@ -335,6 +354,7 @@ CHIP_ERROR Device::OpenCommissioningWindow(uint16_t timeout, uint32_t iteration, Callback::Cancelable * successCallback = mOpenPairingSuccessCallback.Cancel(); Callback::Cancelable * failureCallback = mOpenPairingFailureCallback.Cancel(); + mCommissioningWindowCallback = callback; if (option != CommissioningWindowOption::kOriginalSetupCode) { bool randomSetupPIN = (option == CommissioningWindowOption::kTokenWithRandomPIN); @@ -361,6 +381,8 @@ CHIP_ERROR Device::OpenCommissioningWindow(uint16_t timeout, uint32_t iteration, setupPayload.version = 0; setupPayload.rendezvousInformation = RendezvousInformationFlags(RendezvousInformationFlag::kOnNetwork); + mSetupPayload = setupPayload; + return CHIP_NO_ERROR; } @@ -368,7 +390,7 @@ CHIP_ERROR Device::OpenPairingWindow(uint16_t timeout, CommissioningWindowOption { ByteSpan salt(reinterpret_cast(kSpake2pKeyExchangeSalt), strlen(kSpake2pKeyExchangeSalt)); - return OpenCommissioningWindow(timeout, kPBKDFMinimumIterations, option, salt, setupPayload); + return OpenCommissioningWindow(timeout, kPBKDFMinimumIterations, option, salt, nullptr, setupPayload); } void Device::UpdateSession(bool connected) diff --git a/src/controller/CHIPDevice.h b/src/controller/CHIPDevice.h index 9b7cfed06c9d0d..d98ae89f63d3d1 100644 --- a/src/controller/CHIPDevice.h +++ b/src/controller/CHIPDevice.h @@ -103,6 +103,7 @@ class Device; typedef void (*OnDeviceConnected)(void * context, Device * device); typedef void (*OnDeviceConnectionFailure)(void * context, NodeId deviceId, CHIP_ERROR error); +typedef void (*OnOpenCommissioningWindow)(void * context, NodeId deviceId, CHIP_ERROR status, SetupPayload payload); class DLL_EXPORT Device : public Messaging::ExchangeDelegate, public SessionEstablishmentDelegate { @@ -289,12 +290,14 @@ class DLL_EXPORT Device : public Messaging::ExchangeDelegate, public SessionEsta * the PIN code provied in the setupPayload). * @param[in] salt The PAKE Salt associated with the PAKE Passcode ID and ephemeral PAKE passcode * verifier to be used for this commissioning. + * @param[in] callback The function to be called on success or failure of opening of commissioning window. * @param[out] setupPayload The setup payload corresponding to the generated onboarding token. * * @return CHIP_ERROR CHIP_NO_ERROR on success, or corresponding error */ CHIP_ERROR OpenCommissioningWindow(uint16_t timeout, uint32_t iteration, CommissioningWindowOption option, - const ByteSpan & salt, SetupPayload & setupPayload); + const ByteSpan & salt, Callback::Callback * callback, + SetupPayload & setupPayload); /** * @brief @@ -579,6 +582,9 @@ class DLL_EXPORT Device : public Messaging::ExchangeDelegate, public SessionEsta Callback::CallbackDeque mConnectionSuccess; Callback::CallbackDeque mConnectionFailure; + Callback::Callback * mCommissioningWindowCallback = nullptr; + SetupPayload mSetupPayload; + Callback::Callback mOpenPairingSuccessCallback; Callback::Callback mOpenPairingFailureCallback; }; diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 6189c49b1448c7..71e213aeeeee1d 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -543,9 +543,9 @@ CHIP_ERROR DeviceController::GetPeerAddressAndPort(PeerId peerId, Inet::IPAddres #if CHIP_DEVICE_CONFIG_ENABLE_DNSSD void DeviceController::OnNodeIdResolved(const chip::Dnssd::ResolvedNodeData & nodeData) { - CHIP_ERROR err = CHIP_NO_ERROR; - Device * device = nullptr; - Inet::InterfaceId interfaceId = INET_NULL_INTERFACEID; + CHIP_ERROR err = CHIP_NO_ERROR; + Device * device = nullptr; + Inet::InterfaceId interfaceId; err = GetDevice(nodeData.mPeerId.GetNodeId(), &device); SuccessOrExit(err); @@ -875,8 +875,9 @@ CHIP_ERROR DeviceCommissioner::OperationalDiscoveryComplete(NodeId remoteDeviceI return GetConnectedDevice(remoteDeviceId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback); } -CHIP_ERROR DeviceCommissioner::OpenCommissioningWindow(NodeId deviceId, uint16_t timeout, uint16_t iteration, - uint16_t discriminator, uint8_t option) +CHIP_ERROR DeviceCommissioner::OpenCommissioningWindowWithCallback(NodeId deviceId, uint16_t timeout, uint16_t iteration, + uint16_t discriminator, uint8_t option, + Callback::Callback * callback) { ChipLogProgress(Controller, "OpenCommissioningWindow for device ID %" PRIu64, deviceId); VerifyOrReturnError(mState == State::Initialized, CHIP_ERROR_INCORRECT_STATE); @@ -908,7 +909,7 @@ CHIP_ERROR DeviceCommissioner::OpenCommissioningWindow(NodeId deviceId, uint16_t return CHIP_ERROR_INVALID_ARGUMENT; } - ReturnErrorOnFailure(device->OpenCommissioningWindow(timeout, iteration, commissioningWindowOption, salt, payload)); + ReturnErrorOnFailure(device->OpenCommissioningWindow(timeout, iteration, commissioningWindowOption, salt, callback, payload)); if (commissioningWindowOption != Device::CommissioningWindowOption::kOriginalSetupCode) { diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index 416238f3a1417c..d5920d5cfaa9bd 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -460,7 +460,30 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, * @return CHIP_ERROR CHIP_NO_ERROR on success, or corresponding error */ CHIP_ERROR OpenCommissioningWindow(NodeId deviceId, uint16_t timeout, uint16_t iteration, uint16_t discriminator, - uint8_t option); + uint8_t option) + { + return OpenCommissioningWindowWithCallback(deviceId, timeout, iteration, discriminator, option, nullptr); + } + + /** + * @brief + * Trigger a paired device to re-enter the commissioning mode. The device will exit the commissioning mode + * after a successful commissioning, or after the given `timeout` time. + * + * @param[in] deviceId The device Id. + * @param[in] timeout The commissioning mode should terminate after this much time. + * @param[in] iteration The PAKE iteration count associated with the PAKE Passcode ID and ephemeral + * PAKE passcode verifier to be used for this commissioning. + * @param[in] discriminator The long discriminator for the DNS-SD advertisement. + * @param[in] option The commissioning window can be opened using the original setup code, or an + * onboarding token can be generated using a random setup PIN code (or with + * the PIN code provied in the setupPayload). + * @param[in] callback The function to be called on success or failure of opening of commissioning window. + * + * @return CHIP_ERROR CHIP_NO_ERROR on success, or corresponding error + */ + CHIP_ERROR OpenCommissioningWindowWithCallback(NodeId deviceId, uint16_t timeout, uint16_t iteration, uint16_t discriminator, + uint8_t option, Callback::Callback * callback); //////////// SessionEstablishmentDelegate Implementation /////////////// void OnSessionEstablishmentError(CHIP_ERROR error) override; diff --git a/src/controller/SetUpCodePairer.cpp b/src/controller/SetUpCodePairer.cpp index dd776360637b47..f4b7ac3ae6cfba 100644 --- a/src/controller/SetUpCodePairer.cpp +++ b/src/controller/SetUpCodePairer.cpp @@ -167,7 +167,7 @@ void SetUpCodePairer::OnDiscoveredDevice(const Dnssd::DiscoveredNodeData & nodeD LogErrorOnFailure(StopConnectOverIP()); LogErrorOnFailure(StopConnectOverSoftAP()); - Inet::InterfaceId interfaceId = nodeData.ipAddress[0].IsIPv6LinkLocal() ? nodeData.interfaceId[0] : INET_NULL_INTERFACEID; + Inet::InterfaceId interfaceId = nodeData.ipAddress[0].IsIPv6LinkLocal() ? nodeData.interfaceId[0] : Inet::InterfaceId::Null(); Transport::PeerAddress peerAddress = Transport::PeerAddress::UDP(nodeData.ipAddress[0], nodeData.port, interfaceId); RendezvousParameters params = RendezvousParameters().SetPeerAddress(peerAddress); OnDeviceDiscovered(params); diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 9587df8099dea4..16321499cd246f 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -6523,6 +6523,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -7399,6 +7414,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "min setpoint dead band", + "code": 25, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "25", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "control sequence of operation", "code": 27, @@ -8751,7 +8781,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -8766,7 +8796,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -8781,7 +8811,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -8796,11 +8826,11 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -8863,7 +8893,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -8878,7 +8908,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -8893,7 +8923,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -8908,7 +8938,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -8923,7 +8953,7 @@ "reportableChange": 0 }, { - "name": "scaled value", + "name": "ScaledValue", "code": 16, "mfgCode": null, "side": "server", @@ -8938,7 +8968,7 @@ "reportableChange": 0 }, { - "name": "scaled tolerance", + "name": "ScaledTolerance", "code": 19, "mfgCode": null, "side": "server", @@ -9005,7 +9035,7 @@ "commands": [], "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -9020,7 +9050,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -9035,7 +9065,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -9049,6 +9079,21 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "ClusterRevision", "code": 65533, @@ -9151,7 +9196,7 @@ "code": 3, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, @@ -10992,6 +11037,14 @@ "source": "client", "incoming": 0, "outgoing": 1 + }, + { + "name": "TestNullableOptionalRequest", + "code": 15, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 } ], "attributes": [ @@ -11051,6 +11104,14 @@ "source": "server", "incoming": 1, "outgoing": 0 + }, + { + "name": "TestNullableOptionalResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 } ], "attributes": [ @@ -11842,6 +11903,5 @@ "endpointVersion": null, "deviceIdentifier": null } - ], - "log": [] + ] } \ No newline at end of file diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index aea41f7831cb30..46ef84430c4d5e 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -6039,6 +6039,76 @@ class CHIPTestClusterClusterTestListInt8UReverseResponseCallback jobject javaCallbackRef; }; +class CHIPTestClusterClusterTestNullableOptionalResponseCallback + : public Callback::Callback +{ +public: + CHIPTestClusterClusterTestNullableOptionalResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) + { + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } + } + ~CHIPTestClusterClusterTestNullableOptionalResponseCallback() + { + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); + }; + + static void CallbackFn(void * context, bool wasPresent, bool wasNull, uint8_t value) + { + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + CHIPTestClusterClusterTestNullableOptionalResponseCallback * cppCallback = nullptr; + + VerifyOrExit(env != nullptr, err = CHIP_JNI_ERROR_NO_ENV); + + cppCallback = reinterpret_cast(context); + VerifyOrExit(cppCallback != nullptr, err = CHIP_JNI_ERROR_NULL_OBJECT); + + javaCallbackRef = cppCallback->javaCallbackRef; + VerifyOrExit(javaCallbackRef != nullptr, err = CHIP_NO_ERROR); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(ZZI)V", &javaMethod); + SuccessOrExit(err); + + env->CallVoidMethod(javaCallbackRef, javaMethod, static_cast(wasPresent), static_cast(wasNull), + static_cast(value)); + + exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Error invoking Java callback: %" CHIP_ERROR_FORMAT, err.Format()); + } + if (cppCallback != nullptr) + { + cppCallback->Cancel(); + delete cppCallback; + } + } + +private: + jobject javaCallbackRef; +}; + class CHIPTestClusterClusterTestSpecificResponseCallback : public Callback::Callback { public: @@ -16459,6 +16529,31 @@ JNI_METHOD(void, FlowMeasurementCluster, readMaxMeasuredValueAttribute) onFailure.release(); } +JNI_METHOD(void, FlowMeasurementCluster, readToleranceAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + FlowMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, FlowMeasurementCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -23737,6 +23832,80 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, readMaxMeasuredValueAttribu onFailure.release(); } +JNI_METHOD(void, RelativeHumidityMeasurementCluster, readToleranceAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, RelativeHumidityMeasurementCluster, subscribeToleranceAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->SubscribeAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), + static_cast(maxInterval)); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, RelativeHumidityMeasurementCluster, reportToleranceAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onReport( + Platform::New(callback, true), Platform::Delete); + VerifyOrReturn(onReport.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + RelativeHumidityMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReportAttributeTolerance(onReport->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, + ReturnIllegalStateException(env, callback, "Error registering for attribute reporting", err)); + + onReport.release(); +} + JNI_METHOD(void, RelativeHumidityMeasurementCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -25052,6 +25221,80 @@ JNI_METHOD(void, TemperatureMeasurementCluster, readMaxMeasuredValueAttribute) onFailure.release(); } +JNI_METHOD(void, TemperatureMeasurementCluster, readToleranceAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TemperatureMeasurementCluster, subscribeToleranceAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint minInterval, jint maxInterval) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->SubscribeAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel(), static_cast(minInterval), + static_cast(maxInterval)); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error subscribing to attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, TemperatureMeasurementCluster, reportToleranceAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onReport( + Platform::New(callback, true), Platform::Delete); + VerifyOrReturn(onReport.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native report callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + TemperatureMeasurementCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReportAttributeTolerance(onReport->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, + ReturnIllegalStateException(env, callback, "Error registering for attribute reporting", err)); + + onReport.release(); +} + JNI_METHOD(void, TemperatureMeasurementCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -25397,6 +25640,55 @@ JNI_METHOD(void, TestClusterCluster, testNotHandled)(JNIEnv * env, jobject self, err = cppCluster->TestNotHandled(onSuccess->Cancel(), onFailure->Cancel()); SuccessOrExit(err); +exit: + if (err != CHIP_NO_ERROR) + { + jthrowable exception; + jmethodID method; + + err = JniReferences::GetInstance().FindMethod(env, callback, "onError", "(Ljava/lang/Exception;)V", &method); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); + return; + } + + err = CreateIllegalStateException(env, "Error invoking cluster", err, exception); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Error throwing IllegalStateException %" CHIP_ERROR_FORMAT, err.Format()); + return; + } + env->CallVoidMethod(callback, method, exception); + } + else + { + onSuccess.release(); + onFailure.release(); + } +} +JNI_METHOD(void, TestClusterCluster, testNullableOptionalRequest) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint arg1) +{ + chip::DeviceLayer::StackLock lock; + CHIP_ERROR err = CHIP_NO_ERROR; + TestClusterCluster * cppCluster; + + std::unique_ptr + onSuccess(Platform::New(callback), + Platform::Delete); + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrExit(onSuccess.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + VerifyOrExit(onFailure.get() != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + + cppCluster = reinterpret_cast(clusterPtr); + VerifyOrExit(cppCluster != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + + err = cppCluster->TestNullableOptionalRequest(onSuccess->Cancel(), onFailure->Cancel(), arg1); + SuccessOrExit(err); + exit: if (err != CHIP_NO_ERROR) { @@ -27589,6 +27881,58 @@ JNI_METHOD(void, ThermostatCluster, writeMaxCoolSetpointLimitAttribute) onFailure.release(); } +JNI_METHOD(void, ThermostatCluster, readMinSetpointDeadBandAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeMinSetpointDeadBand(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, ThermostatCluster, writeMinSetpointDeadBandAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + ThermostatCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->WriteAttributeMinSetpointDeadBand(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, ThermostatCluster, readControlSequenceOfOperationAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { @@ -31430,6 +31774,31 @@ JNI_METHOD(void, WindowCoveringCluster, reportSafetyStatusAttribute)(JNIEnv * en onReport.release(); } +JNI_METHOD(void, WindowCoveringCluster, readFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + std::unique_ptr onSuccess( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + Platform::New(callback), Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + WindowCoveringCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel()); + VerifyOrReturn(err == CHIP_NO_ERROR, ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, WindowCoveringCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index af12c13132cc5a..effa0be5c0a9af 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -2804,6 +2804,10 @@ public void readMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { readMaxMeasuredValueAttribute(chipClusterPtr, callback); } + public void readToleranceAttribute(IntegerAttributeCallback callback) { + readToleranceAttribute(chipClusterPtr, callback); + } + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } @@ -2817,6 +2821,9 @@ private native void readMinMeasuredValueAttribute( private native void readMaxMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); + private native void readToleranceAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); } @@ -5160,6 +5167,19 @@ public void readMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { readMaxMeasuredValueAttribute(chipClusterPtr, callback); } + public void readToleranceAttribute(IntegerAttributeCallback callback) { + readToleranceAttribute(chipClusterPtr, callback); + } + + public void subscribeToleranceAttribute( + DefaultClusterCallback callback, int minInterval, int maxInterval) { + subscribeToleranceAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void reportToleranceAttribute(IntegerAttributeCallback callback) { + reportToleranceAttribute(chipClusterPtr, callback); + } + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } @@ -5179,6 +5199,15 @@ private native void readMinMeasuredValueAttribute( private native void readMaxMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); + private native void readToleranceAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeToleranceAttribute( + long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); + + private native void reportToleranceAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); } @@ -5643,6 +5672,19 @@ public void readMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { readMaxMeasuredValueAttribute(chipClusterPtr, callback); } + public void readToleranceAttribute(IntegerAttributeCallback callback) { + readToleranceAttribute(chipClusterPtr, callback); + } + + public void subscribeToleranceAttribute( + DefaultClusterCallback callback, int minInterval, int maxInterval) { + subscribeToleranceAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void reportToleranceAttribute(IntegerAttributeCallback callback) { + reportToleranceAttribute(chipClusterPtr, callback); + } + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } @@ -5662,6 +5704,15 @@ private native void readMinMeasuredValueAttribute( private native void readMaxMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); + private native void readToleranceAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeToleranceAttribute( + long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); + + private native void reportToleranceAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); } @@ -5708,6 +5759,11 @@ public void testNotHandled(DefaultClusterCallback callback) { testNotHandled(chipClusterPtr, callback); } + public void testNullableOptionalRequest( + TestNullableOptionalResponseCallback callback, int arg1) { + testNullableOptionalRequest(chipClusterPtr, callback, arg1); + } + public void testSpecific(TestSpecificResponseCallback callback) { testSpecific(chipClusterPtr, callback); } @@ -5747,6 +5803,9 @@ private native void testListStructArgumentRequest( private native void testNotHandled(long chipClusterPtr, DefaultClusterCallback callback); + private native void testNullableOptionalRequest( + long chipClusterPtr, TestNullableOptionalResponseCallback callback, int arg1); + private native void testSpecific(long chipClusterPtr, TestSpecificResponseCallback callback); private native void testStructArgumentRequest( @@ -5782,6 +5841,12 @@ void onSuccess( void onError(Exception error); } + public interface TestNullableOptionalResponseCallback { + void onSuccess(boolean wasPresent, boolean wasNull, int value); + + void onError(Exception error); + } + public interface TestSpecificResponseCallback { void onSuccess(int returnValue); @@ -6293,6 +6358,14 @@ public void writeMaxCoolSetpointLimitAttribute(DefaultClusterCallback callback, writeMaxCoolSetpointLimitAttribute(chipClusterPtr, callback, value); } + public void readMinSetpointDeadBandAttribute(IntegerAttributeCallback callback) { + readMinSetpointDeadBandAttribute(chipClusterPtr, callback); + } + + public void writeMinSetpointDeadBandAttribute(DefaultClusterCallback callback, int value) { + writeMinSetpointDeadBandAttribute(chipClusterPtr, callback, value); + } + public void readControlSequenceOfOperationAttribute(IntegerAttributeCallback callback) { readControlSequenceOfOperationAttribute(chipClusterPtr, callback); } @@ -6387,6 +6460,12 @@ private native void readMaxCoolSetpointLimitAttribute( private native void writeMaxCoolSetpointLimitAttribute( long chipClusterPtr, DefaultClusterCallback callback, int value); + private native void readMinSetpointDeadBandAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void writeMinSetpointDeadBandAttribute( + long chipClusterPtr, DefaultClusterCallback callback, int value); + private native void readControlSequenceOfOperationAttribute( long chipClusterPtr, IntegerAttributeCallback callback); @@ -7474,6 +7553,10 @@ public void reportSafetyStatusAttribute(IntegerAttributeCallback callback) { reportSafetyStatusAttribute(chipClusterPtr, callback); } + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); } @@ -7581,6 +7664,9 @@ private native void subscribeSafetyStatusAttribute( private native void reportSafetyStatusAttribute( long chipClusterPtr, IntegerAttributeCallback callback); + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + private native void readClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback); } diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index 2fadb2cf7286be..6b2a7d0a3048cb 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -4029,6 +4029,16 @@ chip::ChipError::StorageType chip_ime_ReadAttribute_FlowMeasurement_MaxMeasuredV return cluster.ReadAttributeMaxMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); } +chip::ChipError::StorageType chip_ime_ReadAttribute_FlowMeasurement_Tolerance(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::FlowMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + chip::ChipError::StorageType chip_ime_ReadAttribute_FlowMeasurement_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) @@ -6204,6 +6214,29 @@ chip::ChipError::StorageType chip_ime_ReadAttribute_RelativeHumidityMeasurement_ return cluster.ReadAttributeMaxMeasuredValue(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); } +chip::ChipError::StorageType chip_ime_ReadAttribute_RelativeHumidityMeasurement_Tolerance(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_RelativeHumidityMeasurement_Tolerance(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + chip::ChipError::StorageType chip_ime_ReadAttribute_RelativeHumidityMeasurement_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) @@ -6606,6 +6639,29 @@ chip::ChipError::StorageType chip_ime_ReadAttribute_TemperatureMeasurement_MaxMe return cluster.ReadAttributeMaxMeasuredValue(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); } +chip::ChipError::StorageType chip_ime_ReadAttribute_TemperatureMeasurement_Tolerance(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_SubscribeAttribute_TemperatureMeasurement_Tolerance(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + uint16_t minInterval, + uint16_t maxInterval) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster + .SubscribeAttributeTolerance(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel(), minInterval, maxInterval) + .AsInteger(); +} + chip::ChipError::StorageType chip_ime_ReadAttribute_TemperatureMeasurement_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) @@ -6684,6 +6740,15 @@ chip::ChipError::StorageType chip_ime_AppendCommand_TestCluster_TestNotHandled(c cluster.Associate(device, ZCLendpointId); return cluster.TestNotHandled(nullptr, nullptr).AsInteger(); } +chip::ChipError::StorageType chip_ime_AppendCommand_TestCluster_TestNullableOptionalRequest(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId, uint8_t arg1) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.TestNullableOptionalRequest(nullptr, nullptr, arg1).AsInteger(); +} chip::ChipError::StorageType chip_ime_AppendCommand_TestCluster_TestSpecific(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId) { @@ -7449,6 +7514,26 @@ chip::ChipError::StorageType chip_ime_WriteAttribute_Thermostat_MaxCoolSetpointL return cluster.WriteAttributeMaxCoolSetpointLimit(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) .AsInteger(); } +chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_MinSetpointDeadBand(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeMinSetpointDeadBand(gInt8sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + +chip::ChipError::StorageType chip_ime_WriteAttribute_Thermostat_MinSetpointDeadBand(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, chip::GroupId, + int8_t value) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.WriteAttributeMinSetpointDeadBand(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), value) + .AsInteger(); +} chip::ChipError::StorageType chip_ime_ReadAttribute_Thermostat_ControlSequenceOfOperation(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) @@ -8827,6 +8912,16 @@ chip::ChipError::StorageType chip_ime_SubscribeAttribute_WindowCovering_SafetySt .AsInteger(); } +chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_FeatureMap(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT.AsInteger()); + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeFeatureMap(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()).AsInteger(); +} + chip::ChipError::StorageType chip_ime_ReadAttribute_WindowCovering_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId /* ZCLgroupId */) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 340432d9e6fcc9..358dd4a832f2e4 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -1520,6 +1520,11 @@ class ChipClusters: "attributeId": 0x00000002, "type": "int", }, + 0x00000003: { + "attributeName": "Tolerance", + "attributeId": 0x00000003, + "type": "int", + }, 0x0000FFFD: { "attributeName": "ClusterRevision", "attributeId": 0x0000FFFD, @@ -2819,6 +2824,12 @@ class ChipClusters: "attributeId": 0x00000002, "type": "int", }, + 0x00000003: { + "attributeName": "Tolerance", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + }, 0x0000FFFD: { "attributeName": "ClusterRevision", "attributeId": 0x0000FFFD, @@ -3080,6 +3091,12 @@ class ChipClusters: "attributeId": 0x00000002, "type": "int", }, + 0x00000003: { + "attributeName": "Tolerance", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + }, 0x0000FFFD: { "attributeName": "ClusterRevision", "attributeId": 0x0000FFFD, @@ -3145,6 +3162,13 @@ class ChipClusters: "args": { }, }, + 0x0000000F: { + "commandId": 0x0000000F, + "commandName": "TestNullableOptionalRequest", + "args": { + "arg1": "int", + }, + }, 0x00000002: { "commandId": 0x00000002, "commandName": "TestSpecific", @@ -3437,6 +3461,12 @@ class ChipClusters: "type": "int", "writable": True, }, + 0x00000019: { + "attributeName": "MinSetpointDeadBand", + "attributeId": 0x00000019, + "type": "int", + "writable": True, + }, 0x0000001B: { "attributeName": "ControlSequenceOfOperation", "attributeId": 0x0000001B, @@ -4096,6 +4126,11 @@ class ChipClusters: "type": "int", "reportable": True, }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + }, 0x0000FFFD: { "attributeName": "ClusterRevision", "attributeId": 0x0000FFFD, @@ -5048,6 +5083,11 @@ def ClusterTestCluster_CommandTestNotHandled(self, device: ctypes.c_void_p, ZCLe device, ZCLendpoint, ZCLgroupid ) + def ClusterTestCluster_CommandTestNullableOptionalRequest(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, arg1: int): + return self._chipLib.chip_ime_AppendCommand_TestCluster_TestNullableOptionalRequest( + device, ZCLendpoint, ZCLgroupid, arg1 + ) + def ClusterTestCluster_CommandTestSpecific(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_AppendCommand_TestCluster_TestSpecific( device, ZCLendpoint, ZCLgroupid @@ -5688,6 +5728,9 @@ def ClusterFlowMeasurement_ReadAttributeMinMeasuredValue(self, device: ctypes.c_ def ClusterFlowMeasurement_ReadAttributeMaxMeasuredValue(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_FlowMeasurement_MaxMeasuredValue(device, ZCLendpoint, ZCLgroupid) + def ClusterFlowMeasurement_ReadAttributeTolerance(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_FlowMeasurement_Tolerance(device, ZCLendpoint, ZCLgroupid) + def ClusterFlowMeasurement_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_FlowMeasurement_ClusterRevision(device, ZCLendpoint, ZCLgroupid) @@ -6120,6 +6163,12 @@ def ClusterRelativeHumidityMeasurement_ReadAttributeMinMeasuredValue(self, devic def ClusterRelativeHumidityMeasurement_ReadAttributeMaxMeasuredValue(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_RelativeHumidityMeasurement_MaxMeasuredValue(device, ZCLendpoint, ZCLgroupid) + def ClusterRelativeHumidityMeasurement_ReadAttributeTolerance(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_RelativeHumidityMeasurement_Tolerance(device, ZCLendpoint, ZCLgroupid) + + def ClusterRelativeHumidityMeasurement_SubscribeAttributeTolerance(self, device: ctypes.c_void_p, ZCLendpoint: int, minInterval: int, maxInterval: int): + return self._chipLib.chip_ime_SubscribeAttribute_RelativeHumidityMeasurement_Tolerance(device, ZCLendpoint, minInterval, maxInterval) + def ClusterRelativeHumidityMeasurement_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_RelativeHumidityMeasurement_ClusterRevision(device, ZCLendpoint, ZCLgroupid) @@ -6195,6 +6244,12 @@ def ClusterTemperatureMeasurement_ReadAttributeMinMeasuredValue(self, device: ct def ClusterTemperatureMeasurement_ReadAttributeMaxMeasuredValue(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_MaxMeasuredValue(device, ZCLendpoint, ZCLgroupid) + def ClusterTemperatureMeasurement_ReadAttributeTolerance(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_Tolerance(device, ZCLendpoint, ZCLgroupid) + + def ClusterTemperatureMeasurement_SubscribeAttributeTolerance(self, device: ctypes.c_void_p, ZCLendpoint: int, minInterval: int, maxInterval: int): + return self._chipLib.chip_ime_SubscribeAttribute_TemperatureMeasurement_Tolerance(device, ZCLendpoint, minInterval, maxInterval) + def ClusterTemperatureMeasurement_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_ClusterRevision(device, ZCLendpoint, ZCLgroupid) @@ -6404,6 +6459,12 @@ def ClusterThermostat_ReadAttributeMaxCoolSetpointLimit(self, device: ctypes.c_v def ClusterThermostat_WriteAttributeMaxCoolSetpointLimit(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): return self._chipLib.chip_ime_WriteAttribute_Thermostat_MaxCoolSetpointLimit(device, ZCLendpoint, ZCLgroupid, value) + def ClusterThermostat_ReadAttributeMinSetpointDeadBand(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_Thermostat_MinSetpointDeadBand(device, ZCLendpoint, ZCLgroupid) + + def ClusterThermostat_WriteAttributeMinSetpointDeadBand(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, value: int): + return self._chipLib.chip_ime_WriteAttribute_Thermostat_MinSetpointDeadBand(device, ZCLendpoint, ZCLgroupid, value) + def ClusterThermostat_ReadAttributeControlSequenceOfOperation(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_Thermostat_ControlSequenceOfOperation(device, ZCLendpoint, ZCLgroupid) @@ -6773,6 +6834,9 @@ def ClusterWindowCovering_ReadAttributeSafetyStatus(self, device: ctypes.c_void_ def ClusterWindowCovering_SubscribeAttributeSafetyStatus(self, device: ctypes.c_void_p, ZCLendpoint: int, minInterval: int, maxInterval: int): return self._chipLib.chip_ime_SubscribeAttribute_WindowCovering_SafetyStatus(device, ZCLendpoint, minInterval, maxInterval) + def ClusterWindowCovering_ReadAttributeFeatureMap(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_WindowCovering_FeatureMap(device, ZCLendpoint, ZCLgroupid) + def ClusterWindowCovering_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_WindowCovering_ClusterRevision(device, ZCLendpoint, ZCLgroupid) @@ -7779,6 +7843,10 @@ def InitLib(self, chipLib): self._chipLib.chip_ime_ReadAttribute_FlowMeasurement_MaxMeasuredValue.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_FlowMeasurement_MaxMeasuredValue.restype = ctypes.c_uint32 + # Cluster FlowMeasurement ReadAttribute Tolerance + self._chipLib.chip_ime_ReadAttribute_FlowMeasurement_Tolerance.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_FlowMeasurement_Tolerance.restype = ctypes.c_uint32 # Cluster FlowMeasurement ReadAttribute ClusterRevision self._chipLib.chip_ime_ReadAttribute_FlowMeasurement_ClusterRevision.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] @@ -8637,6 +8705,14 @@ def InitLib(self, chipLib): self._chipLib.chip_ime_ReadAttribute_RelativeHumidityMeasurement_MaxMeasuredValue.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_RelativeHumidityMeasurement_MaxMeasuredValue.restype = ctypes.c_uint32 + # Cluster RelativeHumidityMeasurement ReadAttribute Tolerance + self._chipLib.chip_ime_ReadAttribute_RelativeHumidityMeasurement_Tolerance.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_RelativeHumidityMeasurement_Tolerance.restype = ctypes.c_uint32 + # Cluster RelativeHumidityMeasurement SubscribeAttribute Tolerance + self._chipLib.chip_ime_SubscribeAttribute_RelativeHumidityMeasurement_Tolerance.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16] + self._chipLib.chip_ime_SubscribeAttribute_RelativeHumidityMeasurement_Tolerance.restype = ctypes.c_uint32 # Cluster RelativeHumidityMeasurement ReadAttribute ClusterRevision self._chipLib.chip_ime_ReadAttribute_RelativeHumidityMeasurement_ClusterRevision.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] @@ -8791,6 +8867,14 @@ def InitLib(self, chipLib): self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_MaxMeasuredValue.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_MaxMeasuredValue.restype = ctypes.c_uint32 + # Cluster TemperatureMeasurement ReadAttribute Tolerance + self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_Tolerance.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_Tolerance.restype = ctypes.c_uint32 + # Cluster TemperatureMeasurement SubscribeAttribute Tolerance + self._chipLib.chip_ime_SubscribeAttribute_TemperatureMeasurement_Tolerance.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16] + self._chipLib.chip_ime_SubscribeAttribute_TemperatureMeasurement_Tolerance.restype = ctypes.c_uint32 # Cluster TemperatureMeasurement ReadAttribute ClusterRevision self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_ClusterRevision.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] @@ -8824,6 +8908,10 @@ def InitLib(self, chipLib): self._chipLib.chip_ime_AppendCommand_TestCluster_TestNotHandled.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_AppendCommand_TestCluster_TestNotHandled.restype = ctypes.c_uint32 + # Cluster TestCluster Command TestNullableOptionalRequest + self._chipLib.chip_ime_AppendCommand_TestCluster_TestNullableOptionalRequest.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint8] + self._chipLib.chip_ime_AppendCommand_TestCluster_TestNullableOptionalRequest.restype = ctypes.c_uint32 # Cluster TestCluster Command TestSpecific self._chipLib.chip_ime_AppendCommand_TestCluster_TestSpecific.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] @@ -9129,6 +9217,14 @@ def InitLib(self, chipLib): self._chipLib.chip_ime_WriteAttribute_Thermostat_MaxCoolSetpointLimit.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_int16] self._chipLib.chip_ime_WriteAttribute_Thermostat_MaxCoolSetpointLimit.restype = ctypes.c_uint32 + # Cluster Thermostat ReadAttribute MinSetpointDeadBand + self._chipLib.chip_ime_ReadAttribute_Thermostat_MinSetpointDeadBand.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_Thermostat_MinSetpointDeadBand.restype = ctypes.c_uint32 + # Cluster Thermostat WriteAttribute MinSetpointDeadBand + self._chipLib.chip_ime_WriteAttribute_Thermostat_MinSetpointDeadBand.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_int8] + self._chipLib.chip_ime_WriteAttribute_Thermostat_MinSetpointDeadBand.restype = ctypes.c_uint32 # Cluster Thermostat ReadAttribute ControlSequenceOfOperation self._chipLib.chip_ime_ReadAttribute_Thermostat_ControlSequenceOfOperation.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] @@ -9662,6 +9758,10 @@ def InitLib(self, chipLib): self._chipLib.chip_ime_SubscribeAttribute_WindowCovering_SafetyStatus.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16] self._chipLib.chip_ime_SubscribeAttribute_WindowCovering_SafetyStatus.restype = ctypes.c_uint32 + # Cluster WindowCovering ReadAttribute FeatureMap + self._chipLib.chip_ime_ReadAttribute_WindowCovering_FeatureMap.argtypes = [ + ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_WindowCovering_FeatureMap.restype = ctypes.c_uint32 # Cluster WindowCovering ReadAttribute ClusterRevision self._chipLib.chip_ime_ReadAttribute_WindowCovering_ClusterRevision.argtypes = [ ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 9e72f64a903927..886fa30a1f36bd 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -10498,47 +10498,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class WindowCovering: id: typing.ClassVar[int] = 0x0102 - class Enums: - class WcEndProductType(IntEnum): - kRollerShade = 0x00 - kRomanShade = 0x01 - kBalloonShade = 0x02 - kWovenWood = 0x03 - kPleatedShade = 0x04 - kCellularShade = 0x05 - kLayeredShade = 0x06 - kLayeredShade2D = 0x07 - kSheerShade = 0x08 - kTiltOnlyInteriorBlind = 0x09 - kInteriorBlind = 0x0A - kVerticalBlindStripCurtain = 0x0B - kInteriorVenetianBlind = 0x0C - kExteriorVenetianBlind = 0x0D - kLateralLeftCurtain = 0x0E - kLateralRightCurtain = 0x0F - kCentralCurtain = 0x10 - kRollerShutter = 0x11 - kExteriorVerticalScreen = 0x12 - kAwningTerracePatio = 0x13 - kAwningVerticalScreen = 0x14 - kTiltOnlyPergola = 0x15 - kSwingingShutter = 0x16 - kSlidingShutter = 0x17 - kUnknown = 0xFF - - class WcType(IntEnum): - kRollershade = 0x00 - kRollershade2Motor = 0x01 - kRollershadeExterior = 0x02 - kRollershadeExterior2Motor = 0x03 - kDrapery = 0x04 - kAwning = 0x05 - kShutter = 0x06 - kTiltBlindTiltOnly = 0x07 - kTiltBlindLiftAndTilt = 0x08 - kProjectorScreen = 0x09 - kUnknown = 0xFF - class Commands: @dataclass class UpOrOpen(ClusterCommand): @@ -20158,6 +20117,51 @@ def descriptor(cls) -> ClusterObjectDescriptor: e: 'str' = None f: 'int' = None + @dataclass + class NullablesAndOptionalsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="nullableInt", Tag=0, Type=uint), + ClusterObjectFieldDescriptor( + Label="optionalInt", Tag=1, Type=uint), + ClusterObjectFieldDescriptor( + Label="nullableOptionalInt", Tag=2, Type=uint), + ClusterObjectFieldDescriptor( + Label="nullableString", Tag=3, Type=str), + ClusterObjectFieldDescriptor( + Label="optionalString", Tag=4, Type=str), + ClusterObjectFieldDescriptor( + Label="nullableOptionalString", Tag=5, Type=str), + ClusterObjectFieldDescriptor( + Label="nullableStruct", Tag=6, Type=TestCluster.Structs.SimpleStruct), + ClusterObjectFieldDescriptor( + Label="optionalStruct", Tag=7, Type=TestCluster.Structs.SimpleStruct), + ClusterObjectFieldDescriptor( + Label="nullableOptionalStruct", Tag=8, Type=TestCluster.Structs.SimpleStruct), + ClusterObjectFieldDescriptor( + Label="nullableList", Tag=9, Type=TestCluster.Enums.SimpleEnum, IsArray=True), + ClusterObjectFieldDescriptor( + Label="optionalList", Tag=10, Type=TestCluster.Enums.SimpleEnum, IsArray=True), + ClusterObjectFieldDescriptor( + Label="nullableOptionalList", Tag=11, Type=TestCluster.Enums.SimpleEnum, IsArray=True), + ]) + + nullableInt: 'uint' = None + optionalInt: 'uint' = None + nullableOptionalInt: 'uint' = None + nullableString: 'str' = None + optionalString: 'str' = None + nullableOptionalString: 'str' = None + nullableStruct: 'TestCluster.Structs.SimpleStruct' = None + optionalStruct: 'TestCluster.Structs.SimpleStruct' = None + nullableOptionalStruct: 'TestCluster.Structs.SimpleStruct' = None + nullableList: typing.List['TestCluster.Enums.SimpleEnum'] = None + optionalList: typing.List['TestCluster.Enums.SimpleEnum'] = None + nullableOptionalList: typing.List['TestCluster.Enums.SimpleEnum'] = None + @dataclass class NestedStruct(ClusterObject): @ChipUtility.classproperty @@ -20462,6 +20466,28 @@ def descriptor(cls) -> ClusterObjectDescriptor: arg5: 'TestCluster.Enums.SimpleEnum' = None arg6: 'bool' = None + @dataclass + class TestNullableOptionalResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x050F + command_id: typing.ClassVar[int] = 0x0006 + is_client: typing.ClassVar[bool] = False + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="wasPresent", Tag=0, Type=bool), + ClusterObjectFieldDescriptor( + Label="wasNull", Tag=1, Type=bool), + ClusterObjectFieldDescriptor( + Label="value", Tag=2, Type=uint), + ]) + + wasPresent: 'bool' = None + wasNull: 'bool' = None + value: 'uint' = None + @dataclass class TestStructArgumentRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050F @@ -20478,6 +20504,103 @@ def descriptor(cls) -> ClusterObjectDescriptor: arg1: 'TestCluster.Structs.SimpleStruct' = None + @dataclass + class TestComplexNullableOptionalResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x050F + command_id: typing.ClassVar[int] = 0x0007 + is_client: typing.ClassVar[bool] = False + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="nullableIntWasNull", Tag=0, Type=bool), + ClusterObjectFieldDescriptor( + Label="nullableIntValue", Tag=1, Type=uint), + ClusterObjectFieldDescriptor( + Label="optionalIntWasPresent", Tag=2, Type=bool), + ClusterObjectFieldDescriptor( + Label="optionalIntValue", Tag=3, Type=uint), + ClusterObjectFieldDescriptor( + Label="nullableOptionalIntWasPresent", Tag=4, Type=bool), + ClusterObjectFieldDescriptor( + Label="nullableOptionalIntWasNull", Tag=5, Type=bool), + ClusterObjectFieldDescriptor( + Label="nullableOptionalIntValue", Tag=6, Type=uint), + ClusterObjectFieldDescriptor( + Label="nullableStringWasNull", Tag=7, Type=bool), + ClusterObjectFieldDescriptor( + Label="nullableStringValue", Tag=8, Type=str), + ClusterObjectFieldDescriptor( + Label="optionalStringWasPresent", Tag=9, Type=bool), + ClusterObjectFieldDescriptor( + Label="optionalStringValue", Tag=10, Type=str), + ClusterObjectFieldDescriptor( + Label="nullableOptionalStringWasPresent", Tag=11, Type=bool), + ClusterObjectFieldDescriptor( + Label="nullableOptionalStringWasNull", Tag=12, Type=bool), + ClusterObjectFieldDescriptor( + Label="nullableOptionalStringValue", Tag=13, Type=str), + ClusterObjectFieldDescriptor( + Label="nullableStructWasNull", Tag=14, Type=bool), + ClusterObjectFieldDescriptor( + Label="nullableStructValue", Tag=15, Type=TestCluster.Structs.SimpleStruct), + ClusterObjectFieldDescriptor( + Label="optionalStructWasPresent", Tag=16, Type=bool), + ClusterObjectFieldDescriptor( + Label="optionalStructValue", Tag=17, Type=TestCluster.Structs.SimpleStruct), + ClusterObjectFieldDescriptor( + Label="nullableOptionalStructWasPresent", Tag=18, Type=bool), + ClusterObjectFieldDescriptor( + Label="nullableOptionalStructWasNull", Tag=19, Type=bool), + ClusterObjectFieldDescriptor( + Label="nullableOptionalStructValue", Tag=20, Type=TestCluster.Structs.SimpleStruct), + ClusterObjectFieldDescriptor( + Label="nullableListWasNull", Tag=21, Type=bool), + ClusterObjectFieldDescriptor( + Label="nullableListValue", Tag=22, Type=TestCluster.Enums.SimpleEnum, IsArray=True), + ClusterObjectFieldDescriptor( + Label="optionalListWasPresent", Tag=23, Type=bool), + ClusterObjectFieldDescriptor( + Label="optionalListValue", Tag=24, Type=TestCluster.Enums.SimpleEnum, IsArray=True), + ClusterObjectFieldDescriptor( + Label="nullableOptionalListWasPresent", Tag=25, Type=bool), + ClusterObjectFieldDescriptor( + Label="nullableOptionalListWasNull", Tag=26, Type=bool), + ClusterObjectFieldDescriptor( + Label="nullableOptionalListValue", Tag=27, Type=TestCluster.Enums.SimpleEnum, IsArray=True), + ]) + + nullableIntWasNull: 'bool' = None + nullableIntValue: 'uint' = None + optionalIntWasPresent: 'bool' = None + optionalIntValue: 'uint' = None + nullableOptionalIntWasPresent: 'bool' = None + nullableOptionalIntWasNull: 'bool' = None + nullableOptionalIntValue: 'uint' = None + nullableStringWasNull: 'bool' = None + nullableStringValue: 'str' = None + optionalStringWasPresent: 'bool' = None + optionalStringValue: 'str' = None + nullableOptionalStringWasPresent: 'bool' = None + nullableOptionalStringWasNull: 'bool' = None + nullableOptionalStringValue: 'str' = None + nullableStructWasNull: 'bool' = None + nullableStructValue: 'TestCluster.Structs.SimpleStruct' = None + optionalStructWasPresent: 'bool' = None + optionalStructValue: 'TestCluster.Structs.SimpleStruct' = None + nullableOptionalStructWasPresent: 'bool' = None + nullableOptionalStructWasNull: 'bool' = None + nullableOptionalStructValue: 'TestCluster.Structs.SimpleStruct' = None + nullableListWasNull: 'bool' = None + nullableListValue: typing.List['TestCluster.Enums.SimpleEnum'] = None + optionalListWasPresent: 'bool' = None + optionalListValue: typing.List['TestCluster.Enums.SimpleEnum'] = None + nullableOptionalListWasPresent: 'bool' = None + nullableOptionalListWasNull: 'bool' = None + nullableOptionalListValue: typing.List['TestCluster.Enums.SimpleEnum'] = None + @dataclass class TestNestedStructArgumentRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x050F @@ -20593,6 +20716,71 @@ def descriptor(cls) -> ClusterObjectDescriptor: arg1: 'uint' = None arg2: 'TestCluster.Enums.SimpleEnum' = None + @dataclass + class TestNullableOptionalRequest(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x050F + command_id: typing.ClassVar[int] = 0x000F + is_client: typing.ClassVar[bool] = True + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="arg1", Tag=0, Type=uint), + ]) + + arg1: 'uint' = None + + @dataclass + class TestComplexNullableOptionalRequest(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x050F + command_id: typing.ClassVar[int] = 0x0010 + is_client: typing.ClassVar[bool] = True + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="nullableInt", Tag=0, Type=uint), + ClusterObjectFieldDescriptor( + Label="optionalInt", Tag=1, Type=uint), + ClusterObjectFieldDescriptor( + Label="nullableOptionalInt", Tag=2, Type=uint), + ClusterObjectFieldDescriptor( + Label="nullableString", Tag=3, Type=str), + ClusterObjectFieldDescriptor( + Label="optionalString", Tag=4, Type=str), + ClusterObjectFieldDescriptor( + Label="nullableOptionalString", Tag=5, Type=str), + ClusterObjectFieldDescriptor( + Label="nullableStruct", Tag=6, Type=TestCluster.Structs.SimpleStruct), + ClusterObjectFieldDescriptor( + Label="optionalStruct", Tag=7, Type=TestCluster.Structs.SimpleStruct), + ClusterObjectFieldDescriptor( + Label="nullableOptionalStruct", Tag=8, Type=TestCluster.Structs.SimpleStruct), + ClusterObjectFieldDescriptor( + Label="nullableList", Tag=9, Type=TestCluster.Enums.SimpleEnum, IsArray=True), + ClusterObjectFieldDescriptor( + Label="optionalList", Tag=10, Type=TestCluster.Enums.SimpleEnum, IsArray=True), + ClusterObjectFieldDescriptor( + Label="nullableOptionalList", Tag=11, Type=TestCluster.Enums.SimpleEnum, IsArray=True), + ]) + + nullableInt: 'uint' = None + optionalInt: 'uint' = None + nullableOptionalInt: 'uint' = None + nullableString: 'str' = None + optionalString: 'str' = None + nullableOptionalString: 'str' = None + nullableStruct: 'TestCluster.Structs.SimpleStruct' = None + optionalStruct: 'TestCluster.Structs.SimpleStruct' = None + nullableOptionalStruct: 'TestCluster.Structs.SimpleStruct' = None + nullableList: typing.List['TestCluster.Enums.SimpleEnum'] = None + optionalList: typing.List['TestCluster.Enums.SimpleEnum'] = None + nullableOptionalList: typing.List['TestCluster.Enums.SimpleEnum'] = None + class Attributes: class Boolean(ClusterAttributeDescriptor): @ChipUtility.classproperty diff --git a/src/controller/python/chip/discovery/NodeResolution.cpp b/src/controller/python/chip/discovery/NodeResolution.cpp index dcda6beeae9aee..84f621f82f2472 100644 --- a/src/controller/python/chip/discovery/NodeResolution.cpp +++ b/src/controller/python/chip/discovery/NodeResolution.cpp @@ -45,7 +45,7 @@ class PythonResolverDelegate : public ResolverDelegate mSuccessCallback( // nodeData.mPeerId.GetCompressedFabricId(), // nodeData.mPeerId.GetNodeId(), // - nodeData.mInterfaceId, // + nodeData.mInterfaceId.GetPlatformInterface(), // nodeData.mAddress.ToString(ipAddressBuffer, sizeof(ipAddressBuffer)), // nodeData.mPort // ); diff --git a/src/controller/tests/data_model/BUILD.gn b/src/controller/tests/data_model/BUILD.gn index 1dd31e95667e74..7912f6c724422c 100644 --- a/src/controller/tests/data_model/BUILD.gn +++ b/src/controller/tests/data_model/BUILD.gn @@ -31,6 +31,7 @@ chip_test_suite("interaction-tests") { public_deps = [ "${chip_root}/src/app", "${chip_root}/src/app/common:cluster-objects", + "${chip_root}/src/app/tests:helpers", "${chip_root}/src/messaging/tests:helpers", "${chip_root}/src/transport/raw/tests:helpers", "${nlunit_test_root}:nlunit-test", diff --git a/src/controller/tests/data_model/TestCommands.cpp b/src/controller/tests/data_model/TestCommands.cpp index 2acd3c873aaab1..354e94da3127ee 100644 --- a/src/controller/tests/data_model/TestCommands.cpp +++ b/src/controller/tests/data_model/TestCommands.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -35,19 +36,14 @@ #include #include +using TestContext = chip::Test::AppContext; + using namespace chip; using namespace chip::app::Clusters; namespace { -chip::TransportMgrBase gTransportManager; -chip::Test::LoopbackTransport gLoopback; -chip::Test::IOContext gIOContext; -chip::Messaging::ExchangeManager * gExchangeManager; -secure_channel::MessageCounterManager gMessageCounterManager; chip::ClusterStatus kTestSuccessClusterStatus = 1; chip::ClusterStatus kTestFailureClusterStatus = 2; -using TestContext = chip::Test::MessagingContext; -TestContext sContext; constexpr EndpointId kTestEndpointId = 1; @@ -200,10 +196,10 @@ void TestCommandInteraction::TestDataResponse(nlTestSuite * apSuite, void * apCo responseDirective = kSendDataResponse; chip::Controller::InvokeCommandRequest( - gExchangeManager, sessionHandle, kTestEndpointId, request, onSuccessCb, onFailureCb); + &ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, request, onSuccessCb, onFailureCb); NL_TEST_ASSERT(apSuite, onSuccessWasCalled && !onFailureWasCalled); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } void TestCommandInteraction::TestSuccessNoDataResponse(nlTestSuite * apSuite, void * apContext) @@ -231,10 +227,11 @@ void TestCommandInteraction::TestSuccessNoDataResponse(nlTestSuite * apSuite, vo responseDirective = kSendSuccessStatusCode; - chip::Controller::InvokeCommandRequest(gExchangeManager, sessionHandle, kTestEndpointId, request, onSuccessCb, onFailureCb); + chip::Controller::InvokeCommandRequest(&ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, request, onSuccessCb, + onFailureCb); NL_TEST_ASSERT(apSuite, onSuccessWasCalled && !onFailureWasCalled && statusCheck); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } void TestCommandInteraction::TestFailure(nlTestSuite * apSuite, void * apContext) @@ -262,10 +259,11 @@ void TestCommandInteraction::TestFailure(nlTestSuite * apSuite, void * apContext responseDirective = kSendError; - chip::Controller::InvokeCommandRequest(gExchangeManager, sessionHandle, kTestEndpointId, request, onSuccessCb, onFailureCb); + chip::Controller::InvokeCommandRequest(&ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, request, onSuccessCb, + onFailureCb); NL_TEST_ASSERT(apSuite, !onSuccessWasCalled && onFailureWasCalled && statusCheck); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } void TestCommandInteraction::TestSuccessNoDataResponseWithClusterStatus(nlTestSuite * apSuite, void * apContext) @@ -294,10 +292,11 @@ void TestCommandInteraction::TestSuccessNoDataResponseWithClusterStatus(nlTestSu responseDirective = kSendSuccessStatusCodeWithClusterStatus; - chip::Controller::InvokeCommandRequest(gExchangeManager, sessionHandle, kTestEndpointId, request, onSuccessCb, onFailureCb); + chip::Controller::InvokeCommandRequest(&ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, request, onSuccessCb, + onFailureCb); NL_TEST_ASSERT(apSuite, onSuccessWasCalled && !onFailureWasCalled && statusCheck); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } void TestCommandInteraction::TestFailureWithClusterStatus(nlTestSuite * apSuite, void * apContext) @@ -326,10 +325,11 @@ void TestCommandInteraction::TestFailureWithClusterStatus(nlTestSuite * apSuite, responseDirective = kSendErrorWithClusterStatus; - chip::Controller::InvokeCommandRequest(gExchangeManager, sessionHandle, kTestEndpointId, request, onSuccessCb, onFailureCb); + chip::Controller::InvokeCommandRequest(&ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, request, onSuccessCb, + onFailureCb); NL_TEST_ASSERT(apSuite, !onSuccessWasCalled && onFailureWasCalled && statusCheck); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } // clang-format off @@ -344,51 +344,22 @@ const nlTest sTests[] = }; // clang-format on -int Initialize(void * aContext); -int Finalize(void * aContext); - // clang-format off nlTestSuite sSuite = { - "TestCommands", - &sTests[0], - Initialize, - Finalize + "TestCommands", + &sTests[0], + TestContext::Initialize, + TestContext::Finalize }; // clang-format on -int Initialize(void * aContext) -{ - // Initialize System memory and resources - VerifyOrReturnError(chip::Platform::MemoryInit() == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gIOContext.Init(&sSuite) == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gTransportManager.Init(&gLoopback) == CHIP_NO_ERROR, FAILURE); - - auto * ctx = static_cast(aContext); - VerifyOrReturnError(ctx->Init(&sSuite, &gTransportManager, &gIOContext) == CHIP_NO_ERROR, FAILURE); - - gTransportManager.SetSessionManager(&ctx->GetSecureSessionManager()); - gExchangeManager = &ctx->GetExchangeManager(); - VerifyOrReturnError( - chip::app::InteractionModelEngine::GetInstance()->Init(&ctx->GetExchangeManager(), nullptr) == CHIP_NO_ERROR, FAILURE); - return SUCCESS; -} - -int Finalize(void * aContext) -{ - // Shutdown will ensure no leaked exchange context. - CHIP_ERROR err = reinterpret_cast(aContext)->Shutdown(); - gIOContext.Shutdown(); - chip::Platform::MemoryShutdown(); - return (err == CHIP_NO_ERROR) ? SUCCESS : FAILURE; -} - } // namespace int TestCommandInteractionTest() { - nlTestRunner(&sSuite, &sContext); - + TestContext gContext; + nlTestRunner(&sSuite, &gContext); return (nlTestRunnerStats(&sSuite)); } diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index feb5ef4dc1d8f0..2da76fd7191cd0 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -25,18 +26,12 @@ #include #include +using TestContext = chip::Test::AppContext; + using namespace chip; using namespace chip::app::Clusters; namespace { -chip::TransportMgrBase gTransportManager; -chip::Test::LoopbackTransport gLoopback; -chip::Test::IOContext gIOContext; -chip::Messaging::ExchangeManager * gExchangeManager; -secure_channel::MessageCounterManager gMessageCounterManager; - -using TestContext = chip::Test::MessagingContext; -TestContext sContext; constexpr EndpointId kTestEndpointId = 1; @@ -147,14 +142,14 @@ void TestReadInteraction::TestDataResponse(nlTestSuite * apSuite, void * apConte CHIP_ERROR aError) { onFailureCbInvoked = true; }; chip::Controller::ReadAttribute( - gExchangeManager, sessionHandle, kTestEndpointId, onSuccessCb, onFailureCb); + &ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, onSuccessCb, onFailureCb); chip::app::InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); NL_TEST_ASSERT(apSuite, onSuccessCbInvoked && !onFailureCbInvoked); NL_TEST_ASSERT(apSuite, chip::app::InteractionModelEngine::GetInstance()->GetNumActiveReadClients() == 0); NL_TEST_ASSERT(apSuite, chip::app::InteractionModelEngine::GetInstance()->GetNumActiveReadHandlers() == 0); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } void TestReadInteraction::TestAttributeError(nlTestSuite * apSuite, void * apContext) @@ -180,14 +175,14 @@ void TestReadInteraction::TestAttributeError(nlTestSuite * apSuite, void * apCon }; chip::Controller::ReadAttribute( - gExchangeManager, sessionHandle, kTestEndpointId, onSuccessCb, onFailureCb); + &ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, onSuccessCb, onFailureCb); chip::app::InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); NL_TEST_ASSERT(apSuite, !onSuccessCbInvoked && onFailureCbInvoked); NL_TEST_ASSERT(apSuite, chip::app::InteractionModelEngine::GetInstance()->GetNumActiveReadClients() == 0); NL_TEST_ASSERT(apSuite, chip::app::InteractionModelEngine::GetInstance()->GetNumActiveReadHandlers() == 0); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } void TestReadInteraction::TestReadTimeout(nlTestSuite * apSuite, void * apContext) @@ -213,12 +208,12 @@ void TestReadInteraction::TestReadTimeout(nlTestSuite * apSuite, void * apContex }; chip::Controller::ReadAttribute( - gExchangeManager, sessionHandle, kTestEndpointId, onSuccessCb, onFailureCb); + &ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, onSuccessCb, onFailureCb); NL_TEST_ASSERT(apSuite, chip::app::InteractionModelEngine::GetInstance()->GetNumActiveReadClients() == 1); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 2); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 2); - gExchangeManager->OnConnectionExpired(ctx.GetSessionBobToAlice()); + ctx.GetExchangeManager().OnConnectionExpired(ctx.GetSessionBobToAlice()); NL_TEST_ASSERT(apSuite, !onSuccessCbInvoked && onFailureCbInvoked); NL_TEST_ASSERT(apSuite, chip::app::InteractionModelEngine::GetInstance()->GetNumActiveReadClients() == 0); @@ -226,18 +221,18 @@ void TestReadInteraction::TestReadTimeout(nlTestSuite * apSuite, void * apContex // // TODO: Figure out why I cannot enable this line below. // - // NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 1); + // NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 1); chip::app::InteractionModelEngine::GetInstance()->GetReportingEngine().Run(); - gExchangeManager->OnConnectionExpired(ctx.GetSessionAliceToBob()); + ctx.GetExchangeManager().OnConnectionExpired(ctx.GetSessionAliceToBob()); NL_TEST_ASSERT(apSuite, chip::app::InteractionModelEngine::GetInstance()->GetNumActiveReadHandlers() == 0); // // TODO: Figure out why I cannot enable this line below. // - // NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + // NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } // clang-format off @@ -250,51 +245,22 @@ const nlTest sTests[] = }; // clang-format on -int Initialize(void * aContext); -int Finalize(void * aContext); - // clang-format off nlTestSuite sSuite = { - "TestRead", - &sTests[0], - Initialize, - Finalize + "TestRead", + &sTests[0], + TestContext::Initialize, + TestContext::Finalize }; // clang-format on -int Initialize(void * aContext) -{ - // Initialize System memory and resources - VerifyOrReturnError(chip::Platform::MemoryInit() == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gIOContext.Init(&sSuite) == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gTransportManager.Init(&gLoopback) == CHIP_NO_ERROR, FAILURE); - - auto * ctx = static_cast(aContext); - VerifyOrReturnError(ctx->Init(&sSuite, &gTransportManager, &gIOContext) == CHIP_NO_ERROR, FAILURE); - - gTransportManager.SetSessionManager(&ctx->GetSecureSessionManager()); - gExchangeManager = &ctx->GetExchangeManager(); - VerifyOrReturnError( - chip::app::InteractionModelEngine::GetInstance()->Init(&ctx->GetExchangeManager(), nullptr) == CHIP_NO_ERROR, FAILURE); - return SUCCESS; -} - -int Finalize(void * aContext) -{ - // Shutdown will ensure no leaked exchange context. - CHIP_ERROR err = reinterpret_cast(aContext)->Shutdown(); - gIOContext.Shutdown(); - chip::Platform::MemoryShutdown(); - return (err == CHIP_NO_ERROR) ? SUCCESS : FAILURE; -} - } // namespace int TestReadInteractionTest() { - nlTestRunner(&sSuite, &sContext); - + TestContext gContext; + nlTestRunner(&sSuite, &gContext); return (nlTestRunnerStats(&sSuite)); } diff --git a/src/controller/tests/data_model/TestWrite.cpp b/src/controller/tests/data_model/TestWrite.cpp index 2b38213759e1e3..4498f096116035 100644 --- a/src/controller/tests/data_model/TestWrite.cpp +++ b/src/controller/tests/data_model/TestWrite.cpp @@ -19,6 +19,7 @@ #include "app-common/zap-generated/ids/Clusters.h" #include #include +#include #include #include #include @@ -26,18 +27,12 @@ #include #include +using TestContext = chip::Test::AppContext; + using namespace chip; using namespace chip::app::Clusters; namespace { -chip::TransportMgrBase gTransportManager; -chip::Test::LoopbackTransport gLoopback; -chip::Test::IOContext gIOContext; -chip::Messaging::ExchangeManager * gExchangeManager; -secure_channel::MessageCounterManager gMessageCounterManager; - -using TestContext = chip::Test::MessagingContext; -TestContext sContext; constexpr EndpointId kTestEndpointId = 1; @@ -153,11 +148,11 @@ void TestWriteInteraction::TestDataResponse(nlTestSuite * apSuite, void * apCont CHIP_ERROR aError) { onFailureCbInvoked = true; }; chip::Controller::WriteAttribute( - gExchangeManager, sessionHandle, kTestEndpointId, value, onSuccessCb, onFailureCb); + &ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, value, onSuccessCb, onFailureCb); NL_TEST_ASSERT(apSuite, onSuccessCbInvoked && !onFailureCbInvoked); NL_TEST_ASSERT(apSuite, chip::app::InteractionModelEngine::GetInstance()->GetNumActiveWriteHandlers() == 0); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } void TestWriteInteraction::TestAttributeError(nlTestSuite * apSuite, void * apContext) @@ -192,11 +187,11 @@ void TestWriteInteraction::TestAttributeError(nlTestSuite * apSuite, void * apCo }; chip::Controller::WriteAttribute( - gExchangeManager, sessionHandle, kTestEndpointId, value, onSuccessCb, onFailureCb); + &ctx.GetExchangeManager(), sessionHandle, kTestEndpointId, value, onSuccessCb, onFailureCb); NL_TEST_ASSERT(apSuite, !onSuccessCbInvoked && onFailureCbInvoked); NL_TEST_ASSERT(apSuite, chip::app::InteractionModelEngine::GetInstance()->GetNumActiveWriteHandlers() == 0); - NL_TEST_ASSERT(apSuite, gExchangeManager->GetNumActiveExchanges() == 0); + NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } // clang-format off @@ -208,51 +203,22 @@ const nlTest sTests[] = }; // clang-format on -int Initialize(void * aContext); -int Finalize(void * aContext); - // clang-format off nlTestSuite sSuite = { - "TestWrite", - &sTests[0], - Initialize, - Finalize + "TestWrite", + &sTests[0], + TestContext::Initialize, + TestContext::Finalize }; // clang-format on -int Initialize(void * aContext) -{ - // Initialize System memory and resources - VerifyOrReturnError(chip::Platform::MemoryInit() == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gIOContext.Init(&sSuite) == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gTransportManager.Init(&gLoopback) == CHIP_NO_ERROR, FAILURE); - - auto * ctx = static_cast(aContext); - VerifyOrReturnError(ctx->Init(&sSuite, &gTransportManager, &gIOContext) == CHIP_NO_ERROR, FAILURE); - - gTransportManager.SetSessionManager(&ctx->GetSecureSessionManager()); - gExchangeManager = &ctx->GetExchangeManager(); - VerifyOrReturnError( - chip::app::InteractionModelEngine::GetInstance()->Init(&ctx->GetExchangeManager(), nullptr) == CHIP_NO_ERROR, FAILURE); - return SUCCESS; -} - -int Finalize(void * aContext) -{ - // Shutdown will ensure no leaked exchange context. - CHIP_ERROR err = reinterpret_cast(aContext)->Shutdown(); - gIOContext.Shutdown(); - chip::Platform::MemoryShutdown(); - return (err == CHIP_NO_ERROR) ? SUCCESS : FAILURE; -} - } // namespace int TestWriteInteractionTest() { - nlTestRunner(&sSuite, &sContext); - + TestContext gContext; + nlTestRunner(&sSuite, &gContext); return (nlTestRunnerStats(&sSuite)); } diff --git a/src/credentials/BUILD.gn b/src/credentials/BUILD.gn index a62069b3ed55c9..fa9335993eac9c 100644 --- a/src/credentials/BUILD.gn +++ b/src/credentials/BUILD.gn @@ -46,6 +46,7 @@ static_library("credentials") { "${chip_root}/src/lib/asn1", "${chip_root}/src/lib/core", "${chip_root}/src/lib/support", + "${chip_root}/src/transport/raw", "${nlassert_root}:nlassert", ] } diff --git a/src/credentials/CHIPCert.cpp b/src/credentials/CHIPCert.cpp index 1fcc9503a85245..58f1bdd08a4872 100644 --- a/src/credentials/CHIPCert.cpp +++ b/src/credentials/CHIPCert.cpp @@ -575,7 +575,7 @@ CHIP_ERROR ChipDN::AddAttribute(chip::ASN1::OID oid, uint64_t val) return CHIP_NO_ERROR; } -CHIP_ERROR ChipDN::AddAttribute(chip::ASN1::OID oid, ByteSpan val) +CHIP_ERROR ChipDN::AddAttribute(chip::ASN1::OID oid, CharSpan val) { uint8_t rdnCount = RDNCount(); diff --git a/src/credentials/CHIPCert.h b/src/credentials/CHIPCert.h index f43ca926c5fb05..07f11b4b6f7473 100644 --- a/src/credentials/CHIPCert.h +++ b/src/credentials/CHIPCert.h @@ -196,7 +196,7 @@ enum */ struct ChipRDN { - ByteSpan mString; /**< Attribute value when encoded as a string. */ + CharSpan mString; /**< Attribute value when encoded as a string. */ uint64_t mChipVal; /**< CHIP specific DN attribute value. */ chip::ASN1::OID mAttrOID; /**< DN attribute CHIP OID. */ @@ -231,12 +231,12 @@ class ChipDN * @brief Add string attribute to the DN. * * @param oid String OID for DN attribute. - * @param val A ByteSpan object containing a pointer and length of the DN string attribute + * @param val A CharSpan object containing a pointer and length of the DN string attribute * buffer. The value in the buffer should remain valid while the object is in use. * * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise **/ - CHIP_ERROR AddAttribute(chip::ASN1::OID oid, ByteSpan val); + CHIP_ERROR AddAttribute(chip::ASN1::OID oid, CharSpan val); /** * @brief Determine type of a CHIP certificate. diff --git a/src/credentials/CHIPCertToX509.cpp b/src/credentials/CHIPCertToX509.cpp index 87d23b5563b183..d7ef5af18a6532 100644 --- a/src/credentials/CHIPCertToX509.cpp +++ b/src/credentials/CHIPCertToX509.cpp @@ -54,18 +54,15 @@ static CHIP_ERROR DecodeConvertDN(TLVReader & reader, ASN1Writer & writer, ChipD { CHIP_ERROR err; TLVType outerContainer; - TLVType elemType; Tag tlvTag; uint32_t tlvTagNum; OID attrOID; uint8_t asn1Tag; - const uint8_t * asn1AttrVal; - uint32_t asn1AttrValLen; - uint8_t chipAttrStr[17]; + CharSpan asn1Attr; + char chipAttrStr[17]; // Enter the List TLV element that represents the DN in TLV format. - err = reader.EnterContainer(outerContainer); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.EnterContainer(outerContainer)); // RDNSequence ::= SEQUENCE OF RelativeDistinguishedName ASN1_START_SEQUENCE @@ -78,12 +75,9 @@ static CHIP_ERROR DecodeConvertDN(TLVReader & reader, ASN1Writer & writer, ChipD { // Get the TLV tag, make sure it is a context tag and extract the context tag number. tlvTag = reader.GetTag(); - VerifyOrExit(IsContextTag(tlvTag), err = CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(IsContextTag(tlvTag), CHIP_ERROR_INVALID_TLV_TAG); tlvTagNum = TagNumFromTag(tlvTag); - // Get the element type. - elemType = reader.GetType(); - // Derive the OID of the corresponding ASN.1 attribute from the TLV tag number. // The numeric value of the OID is encoded in the bottom 7 bits of the TLV tag number. // This eliminates the need for a translation table/switch statement but has the @@ -97,55 +91,42 @@ static CHIP_ERROR DecodeConvertDN(TLVReader & reader, ASN1Writer & writer, ChipD // attrOID = GetOID(kOIDCategory_AttributeType, static_cast(tlvTagNum & 0x7f)); - // If the attribute is one of the CHIP-defined DN attributes. - if (IsChipDNAttr(attrOID)) + // For 64-bit CHIP-defined DN attributes. + if (IsChip64bitDNAttr(attrOID)) { - // Verify that the underlying TLV data type is unsigned integer. - VerifyOrExit(elemType == kTLVType_UnsignedInteger, err = CHIP_ERROR_WRONG_TLV_TYPE); - - // Read the value of the CHIP attribute. uint64_t chipAttr; - err = reader.Get(chipAttr); - SuccessOrExit(err); - - // Generate the string representation of the CHIP attribute that will appear in the ASN.1 attribute. - if (IsChip64bitDNAttr(attrOID)) - { - // For CHIP 64-bit attribute the string representation is 16 uppercase hex characters. - snprintf(reinterpret_cast(chipAttrStr), sizeof(chipAttrStr), ChipLogFormatX64, - ChipLogValueX64(chipAttr)); - asn1AttrVal = chipAttrStr; - asn1AttrValLen = 16; - } - else - { - VerifyOrExit(CanCastTo(chipAttr), err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); + ReturnErrorOnFailure(reader.Get(chipAttr)); - // For CHIP 32-bit attribute the string representation is 8 uppercase hex characters. - snprintf(reinterpret_cast(chipAttrStr), sizeof(chipAttrStr), "%08" PRIX32, - static_cast(chipAttr)); - asn1AttrVal = chipAttrStr; - asn1AttrValLen = 8; - } + // For CHIP 64-bit attribute the string representation is 16 uppercase hex characters. + snprintf(chipAttrStr, sizeof(chipAttrStr), ChipLogFormatX64, ChipLogValueX64(chipAttr)); + asn1Attr = CharSpan(chipAttrStr, 16); // The ASN.1 tag for CHIP id attributes is always UTF8String. asn1Tag = kASN1UniversalTag_UTF8String; // Save the CHIP-specific id value in the caller's DN structure. - err = dn.AddAttribute(attrOID, chipAttr); - SuccessOrExit(err); + ReturnErrorOnFailure(dn.AddAttribute(attrOID, chipAttr)); } + // For 32-bit CHIP-defined DN attributes. + else if (IsChip32bitDNAttr(attrOID)) + { + uint32_t chipAttr; + ReturnErrorOnFailure(reader.Get(chipAttr)); + snprintf(chipAttrStr, sizeof(chipAttrStr), "%08" PRIX32, static_cast(chipAttr)); + asn1Attr = CharSpan(chipAttrStr, 8); + + // The ASN.1 tag for CHIP id attributes is always UTF8String. + asn1Tag = kASN1UniversalTag_UTF8String; + + // Save the CHIP-specific id value in the caller's DN structure. + ReturnErrorOnFailure(dn.AddAttribute(attrOID, chipAttr)); + } // Otherwise the attribute is one of the supported X.509 attributes else { - // Verify that the underlying data type is UTF8 string. - VerifyOrExit(elemType == kTLVType_UTF8String, err = CHIP_ERROR_WRONG_TLV_TYPE); - - // Get a pointer the underlying string data, plus its length. - err = reader.GetDataPtr(asn1AttrVal); - SuccessOrExit(err); - asn1AttrValLen = reader.GetLength(); + // Get the attribute span. + ReturnErrorOnFailure(reader.Get(asn1Attr)); // Determine the appropriate ASN.1 tag for the DN attribute. // - DomainComponent is always an IA5String. @@ -161,8 +142,7 @@ static CHIP_ERROR DecodeConvertDN(TLVReader & reader, ASN1Writer & writer, ChipD } // Save the string value in the caller's DN structure. - err = dn.AddAttribute(attrOID, ByteSpan(asn1AttrVal, asn1AttrValLen)); - SuccessOrExit(err); + ReturnErrorOnFailure(dn.AddAttribute(attrOID, asn1Attr)); } // AttributeTypeAndValue ::= SEQUENCE @@ -172,25 +152,21 @@ static CHIP_ERROR DecodeConvertDN(TLVReader & reader, ASN1Writer & writer, ChipD // AttributeType ::= OBJECT IDENTIFIER ASN1_ENCODE_OBJECT_ID(attrOID); + VerifyOrReturnError(CanCastTo(asn1Attr.size()), CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); + // value AttributeValue // AttributeValue ::= ANY -- DEFINED BY AttributeType - err = writer.PutString(asn1Tag, Uint8::to_const_char(asn1AttrVal), static_cast(asn1AttrValLen)); - SuccessOrExit(err); + ReturnErrorOnFailure(writer.PutString(asn1Tag, asn1Attr.data(), static_cast(asn1Attr.size()))); } ASN1_END_SEQUENCE; } ASN1_END_SET; } - err = reader.VerifyEndOfContainer(); - SuccessOrExit(err); + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); } ASN1_END_SEQUENCE; - err = reader.VerifyEndOfContainer(); - SuccessOrExit(err); - - err = reader.ExitContainer(outerContainer); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.ExitContainer(outerContainer)); exit: return err; @@ -200,36 +176,17 @@ static CHIP_ERROR DecodeConvertValidity(TLVReader & reader, ASN1Writer & writer, { CHIP_ERROR err; ASN1UniversalTime asn1Time; - uint64_t chipEpochTime; ASN1_START_SEQUENCE { - err = reader.Next(kTLVType_UnsignedInteger, ContextTag(kTag_NotBefore)); - SuccessOrExit(err); - - err = reader.Get(chipEpochTime); - SuccessOrExit(err); - - VerifyOrExit(CanCastTo(chipEpochTime), err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); - certData.mNotBeforeTime = static_cast(chipEpochTime); - - err = ChipEpochToASN1Time(static_cast(chipEpochTime), asn1Time); - SuccessOrExit(err); - + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_NotBefore))); + ReturnErrorOnFailure(reader.Get(certData.mNotBeforeTime)); + ReturnErrorOnFailure(ChipEpochToASN1Time(certData.mNotBeforeTime, asn1Time)); ASN1_ENCODE_TIME(asn1Time); - err = reader.Next(kTLVType_UnsignedInteger, ContextTag(kTag_NotAfter)); - SuccessOrExit(err); - - err = reader.Get(chipEpochTime); - SuccessOrExit(err); - - VerifyOrExit(CanCastTo(chipEpochTime), err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); - certData.mNotAfterTime = static_cast(chipEpochTime); - - err = ChipEpochToASN1Time(static_cast(chipEpochTime), asn1Time); - SuccessOrExit(err); - + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_NotAfter))); + ReturnErrorOnFailure(reader.Get(certData.mNotAfterTime)); + ReturnErrorOnFailure(ChipEpochToASN1Time(certData.mNotAfterTime, asn1Time)); ASN1_ENCODE_TIME(asn1Time); } ASN1_END_SEQUENCE; @@ -241,27 +198,19 @@ static CHIP_ERROR DecodeConvertValidity(TLVReader & reader, ASN1Writer & writer, static CHIP_ERROR DecodeConvertSubjectPublicKeyInfo(TLVReader & reader, ASN1Writer & writer, ChipCertificateData & certData) { CHIP_ERROR err; - uint64_t pubKeyAlgoId, pubKeyCurveId; - OID pubKeyAlgoOID; - - err = reader.Next(kTLVType_UnsignedInteger, ContextTag(kTag_PublicKeyAlgorithm)); - SuccessOrExit(err); - err = reader.Get(pubKeyAlgoId); - SuccessOrExit(err); - VerifyOrExit(CanCastTo(pubKeyAlgoId), err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); + uint8_t pubKeyAlgoId, pubKeyCurveId; - pubKeyAlgoOID = GetOID(kOIDCategory_PubKeyAlgo, static_cast(pubKeyAlgoId)); - certData.mPubKeyAlgoOID = pubKeyAlgoOID; + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_PublicKeyAlgorithm))); + ReturnErrorOnFailure(reader.Get(pubKeyAlgoId)); - VerifyOrExit(pubKeyAlgoOID == kOID_PubKeyAlgo_ECPublicKey, err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); + certData.mPubKeyAlgoOID = GetOID(kOIDCategory_PubKeyAlgo, pubKeyAlgoId); + VerifyOrReturnError(certData.mPubKeyAlgoOID == kOID_PubKeyAlgo_ECPublicKey, CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); - err = reader.Next(kTLVType_UnsignedInteger, ContextTag(kTag_EllipticCurveIdentifier)); - SuccessOrExit(err); - err = reader.Get(pubKeyCurveId); - SuccessOrExit(err); - VerifyOrExit(CanCastTo(pubKeyCurveId), err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_EllipticCurveIdentifier))); + ReturnErrorOnFailure(reader.Get(pubKeyCurveId)); - certData.mPubKeyCurveOID = GetOID(kOIDCategory_EllipticCurve, static_cast(pubKeyCurveId)); + certData.mPubKeyCurveOID = GetOID(kOIDCategory_EllipticCurve, pubKeyCurveId); + VerifyOrReturnError(certData.mPubKeyCurveOID == kOID_EllipticCurve_prime256v1, CHIP_ERROR_UNSUPPORTED_ELLIPTIC_CURVE); // subjectPublicKeyInfo SubjectPublicKeyInfo, ASN1_START_SEQUENCE @@ -271,7 +220,7 @@ static CHIP_ERROR DecodeConvertSubjectPublicKeyInfo(TLVReader & reader, ASN1Writ ASN1_START_SEQUENCE { // algorithm OBJECT IDENTIFIER, - ASN1_ENCODE_OBJECT_ID(pubKeyAlgoOID); + ASN1_ENCODE_OBJECT_ID(certData.mPubKeyAlgoOID); // EcpkParameters ::= CHOICE { // ecParameters ECParameters, @@ -285,11 +234,7 @@ static CHIP_ERROR DecodeConvertSubjectPublicKeyInfo(TLVReader & reader, ASN1Writ ASN1_END_SEQUENCE; ReturnErrorOnFailure(reader.Next(kTLVType_ByteString, ContextTag(kTag_EllipticCurvePublicKey))); - VerifyOrReturnError(reader.GetLength() == certData.mPublicKey.size(), CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); - - const uint8_t * ptr; - ReturnErrorOnFailure(reader.GetDataPtr(ptr)); - certData.mPublicKey = P256PublicKeySpan(ptr); + ReturnErrorOnFailure(reader.Get(certData.mPublicKey)); static_assert(P256PublicKeySpan().size() <= UINT16_MAX, "Public key size doesn't fit in a uint16_t"); @@ -318,11 +263,8 @@ static CHIP_ERROR DecodeConvertAuthorityKeyIdentifierExtension(TLVReader & reade // KeyIdentifier ::= OCTET STRING VerifyOrReturnError(reader.GetType() == kTLVType_ByteString, CHIP_ERROR_WRONG_TLV_TYPE); VerifyOrReturnError(reader.GetTag() == ContextTag(kTag_AuthorityKeyIdentifier), CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); - VerifyOrReturnError(reader.GetLength() == certData.mAuthKeyId.size(), CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); - const uint8_t * ptr; - ReturnErrorOnFailure(reader.GetDataPtr(ptr)); - certData.mAuthKeyId = CertificateKeyId(ptr); + ReturnErrorOnFailure(reader.Get(certData.mAuthKeyId)); static_assert(CertificateKeyId().size() <= UINT16_MAX, "Authority key id size doesn't fit in a uint16_t"); @@ -346,11 +288,8 @@ static CHIP_ERROR DecodeConvertSubjectKeyIdentifierExtension(TLVReader & reader, // KeyIdentifier ::= OCTET STRING VerifyOrReturnError(reader.GetType() == kTLVType_ByteString, CHIP_ERROR_WRONG_TLV_TYPE); VerifyOrReturnError(reader.GetTag() == ContextTag(kTag_SubjectKeyIdentifier), CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); - VerifyOrReturnError(reader.GetLength() == certData.mSubjectKeyId.size(), CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); - const uint8_t * ptr; - ReturnErrorOnFailure(reader.GetDataPtr(ptr)); - certData.mSubjectKeyId = CertificateKeyId(ptr); + ReturnErrorOnFailure(reader.Get(certData.mSubjectKeyId)); static_assert(CertificateKeyId().size() <= UINT16_MAX, "Subject key id size doesn't fit in a uint16_t"); @@ -363,28 +302,24 @@ static CHIP_ERROR DecodeConvertSubjectKeyIdentifierExtension(TLVReader & reader, static CHIP_ERROR DecodeConvertKeyUsageExtension(TLVReader & reader, ASN1Writer & writer, ChipCertificateData & certData) { CHIP_ERROR err; - uint64_t keyUsageBits; + uint16_t keyUsageBits; certData.mCertFlags.Set(CertFlags::kExtPresent_KeyUsage); // KeyUsage ::= BIT STRING - VerifyOrExit(reader.GetTag() == ContextTag(kTag_KeyUsage), err = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); - VerifyOrExit(reader.GetType() == kTLVType_UnsignedInteger, err = CHIP_ERROR_WRONG_TLV_TYPE); + VerifyOrReturnError(reader.GetTag() == ContextTag(kTag_KeyUsage), CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); - err = reader.Get(keyUsageBits); - SuccessOrExit(err); - - VerifyOrExit(CanCastTo(keyUsageBits), err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); + ReturnErrorOnFailure(reader.Get(keyUsageBits)); { - BitFlags keyUsageFlags(static_cast(keyUsageBits)); - VerifyOrExit(keyUsageFlags.HasOnly(KeyUsageFlags::kDigitalSignature, KeyUsageFlags::kNonRepudiation, - KeyUsageFlags::kKeyEncipherment, KeyUsageFlags::kDataEncipherment, - KeyUsageFlags::kKeyAgreement, KeyUsageFlags::kKeyCertSign, KeyUsageFlags::kCRLSign, - KeyUsageFlags::kEncipherOnly, KeyUsageFlags::kEncipherOnly), - err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); + BitFlags keyUsageFlags(keyUsageBits); + VerifyOrReturnError( + keyUsageFlags.HasOnly(KeyUsageFlags::kDigitalSignature, KeyUsageFlags::kNonRepudiation, KeyUsageFlags::kKeyEncipherment, + KeyUsageFlags::kDataEncipherment, KeyUsageFlags::kKeyAgreement, KeyUsageFlags::kKeyCertSign, + KeyUsageFlags::kCRLSign, KeyUsageFlags::kEncipherOnly, KeyUsageFlags::kEncipherOnly), + CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); - ASN1_ENCODE_BIT_STRING(static_cast(keyUsageBits)); + ASN1_ENCODE_BIT_STRING(keyUsageBits); certData.mKeyUsageFlags = keyUsageFlags; } @@ -395,7 +330,7 @@ static CHIP_ERROR DecodeConvertKeyUsageExtension(TLVReader & reader, ASN1Writer static CHIP_ERROR DecodeConvertBasicConstraintsExtension(TLVReader & reader, ASN1Writer & writer, ChipCertificateData & certData) { - CHIP_ERROR err, nextRes; + CHIP_ERROR err; TLVType outerContainer; certData.mCertFlags.Set(CertFlags::kExtPresent_BasicConstraints); @@ -403,21 +338,16 @@ static CHIP_ERROR DecodeConvertBasicConstraintsExtension(TLVReader & reader, ASN // BasicConstraints ::= SEQUENCE ASN1_START_SEQUENCE { - VerifyOrExit(reader.GetTag() == ContextTag(kTag_BasicConstraints), err = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); - VerifyOrExit(reader.GetType() == kTLVType_Structure, err = CHIP_ERROR_WRONG_TLV_TYPE); + VerifyOrReturnError(reader.GetTag() == ContextTag(kTag_BasicConstraints), CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + VerifyOrReturnError(reader.GetType() == kTLVType_Structure, CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outerContainer); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.EnterContainer(outerContainer)); // cA BOOLEAN DEFAULT FALSE { bool isCA; - - err = reader.Next(kTLVType_Boolean, ContextTag(kTag_BasicConstraints_IsCA)); - SuccessOrExit(err); - - err = reader.Get(isCA); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_BasicConstraints_IsCA))); + ReturnErrorOnFailure(reader.Get(isCA)); if (isCA) { @@ -425,37 +355,25 @@ static CHIP_ERROR DecodeConvertBasicConstraintsExtension(TLVReader & reader, ASN certData.mCertFlags.Set(CertFlags::kIsCA); } - nextRes = reader.Next(); - VerifyOrExit(nextRes == CHIP_NO_ERROR || nextRes == CHIP_END_OF_TLV, err = nextRes); + err = reader.Next(); + VerifyOrReturnError(err == CHIP_NO_ERROR || err == CHIP_END_OF_TLV, err); } // pathLenConstraint INTEGER (0..MAX) OPTIONAL if (reader.GetTag() == ContextTag(kTag_BasicConstraints_PathLenConstraint)) { - uint64_t pathLenConstraint; - - VerifyOrExit(reader.GetType() == kTLVType_UnsignedInteger, err = CHIP_ERROR_WRONG_TLV_TYPE); - - err = reader.Get(pathLenConstraint); - SuccessOrExit(err); - - VerifyOrExit(CanCastTo(pathLenConstraint), err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); + ReturnErrorOnFailure(reader.Get(certData.mPathLenConstraint)); - ASN1_ENCODE_INTEGER(static_cast(pathLenConstraint)); - - certData.mPathLenConstraint = static_cast(pathLenConstraint); + ASN1_ENCODE_INTEGER(certData.mPathLenConstraint); certData.mCertFlags.Set(CertFlags::kPathLenConstraintPresent); - nextRes = reader.Next(); - VerifyOrExit(nextRes == CHIP_END_OF_TLV, err = nextRes); + err = reader.Next(); + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); } - err = reader.VerifyEndOfContainer(); - SuccessOrExit(err); - - err = reader.ExitContainer(outerContainer); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.VerifyEndOfContainer()); + ReturnErrorOnFailure(reader.ExitContainer(outerContainer)); } ASN1_END_SEQUENCE; @@ -473,34 +391,23 @@ static CHIP_ERROR DecodeConvertExtendedKeyUsageExtension(TLVReader & reader, ASN // ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId ASN1_START_SEQUENCE { - VerifyOrExit(reader.GetTag() == ContextTag(kTag_ExtendedKeyUsage), err = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); - VerifyOrExit(reader.GetType() == kTLVType_Array, err = CHIP_ERROR_WRONG_TLV_TYPE); + VerifyOrReturnError(reader.GetTag() == ContextTag(kTag_ExtendedKeyUsage), CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + VerifyOrReturnError(reader.GetType() == kTLVType_Array, CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outerContainer); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.EnterContainer(outerContainer)); - while ((err = reader.Next(kTLVType_UnsignedInteger, AnonymousTag)) == CHIP_NO_ERROR) + while ((err = reader.Next(AnonymousTag)) == CHIP_NO_ERROR) { - uint64_t keyPurposeId; - OID keyPurposeOID; - - err = reader.Get(keyPurposeId); - SuccessOrExit(err); - - VerifyOrExit(CanCastTo(keyPurposeId), err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); - - keyPurposeOID = GetOID(kOIDCategory_KeyPurpose, static_cast(keyPurposeId)); + uint8_t keyPurposeId; + ReturnErrorOnFailure(reader.Get(keyPurposeId)); // KeyPurposeId ::= OBJECT IDENTIFIER - ASN1_ENCODE_OBJECT_ID(keyPurposeOID); + ASN1_ENCODE_OBJECT_ID(GetOID(kOIDCategory_KeyPurpose, keyPurposeId)); certData.mKeyPurposeFlags.Set(static_cast(0x01 << (keyPurposeId - 1))); } - err = reader.VerifyEndOfContainer(); - SuccessOrExit(err); - - err = reader.ExitContainer(outerContainer); - SuccessOrExit(err); + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outerContainer)); } ASN1_END_SEQUENCE; @@ -511,19 +418,15 @@ static CHIP_ERROR DecodeConvertExtendedKeyUsageExtension(TLVReader & reader, ASN static CHIP_ERROR DecodeConvertFutureExtension(TLVReader & tlvReader, ASN1Writer & writer, ChipCertificateData & certData) { CHIP_ERROR err; - const uint8_t * extensionSequence; - uint32_t extensionSequenceLen; + ByteSpan extensionSequence; ASN1Reader reader; - VerifyOrExit(tlvReader.GetTag() == ContextTag(kTag_FutureExtension), err = CHIP_ERROR_INVALID_TLV_TAG); - VerifyOrExit(tlvReader.GetType() == kTLVType_ByteString, err = CHIP_ERROR_WRONG_TLV_TYPE); - - err = tlvReader.GetDataPtr(extensionSequence); - SuccessOrExit(err); + VerifyOrReturnError(tlvReader.GetTag() == ContextTag(kTag_FutureExtension), CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(tlvReader.GetType() == kTLVType_ByteString, CHIP_ERROR_WRONG_TLV_TYPE); - extensionSequenceLen = tlvReader.GetLength(); + ReturnErrorOnFailure(tlvReader.Get(extensionSequence)); - reader.Init(extensionSequence, extensionSequenceLen); + reader.Init(extensionSequence); // Extension ::= SEQUENCE ASN1_PARSE_ENTER_SEQUENCE @@ -533,7 +436,7 @@ static CHIP_ERROR DecodeConvertFutureExtension(TLVReader & tlvReader, ASN1Writer ASN1_PARSE_OBJECT_ID(extensionOID); - VerifyOrExit(extensionOID == kOID_Unknown, err = ASN1_ERROR_UNSUPPORTED_ENCODING); + VerifyOrReturnError(extensionOID == kOID_Unknown, ASN1_ERROR_UNSUPPORTED_ENCODING); // critical BOOLEAN DEFAULT FALSE, ASN1_PARSE_ANY; @@ -551,11 +454,10 @@ static CHIP_ERROR DecodeConvertFutureExtension(TLVReader & tlvReader, ASN1Writer } ASN1_EXIT_SEQUENCE; - VerifyOrExit(CanCastTo(extensionSequenceLen), err = ASN1_ERROR_INVALID_ENCODING); + VerifyOrReturnError(CanCastTo(extensionSequence.size()), ASN1_ERROR_INVALID_ENCODING); // FutureExtension SEQUENCE - err = writer.PutConstructedType(extensionSequence, static_cast(extensionSequenceLen)); - SuccessOrExit(err); + ReturnErrorOnFailure(writer.PutConstructedType(extensionSequence.data(), static_cast(extensionSequence.size()))); exit: return err; @@ -563,29 +465,25 @@ static CHIP_ERROR DecodeConvertFutureExtension(TLVReader & tlvReader, ASN1Writer static CHIP_ERROR DecodeConvertExtension(TLVReader & reader, ASN1Writer & writer, ChipCertificateData & certData) { - CHIP_ERROR err; + CHIP_ERROR err = CHIP_NO_ERROR; Tag tlvTag; uint32_t extensionTagNum; - OID extensionOID; tlvTag = reader.GetTag(); - VerifyOrExit(IsContextTag(tlvTag), err = CHIP_ERROR_INVALID_TLV_TAG); + VerifyOrReturnError(IsContextTag(tlvTag), CHIP_ERROR_INVALID_TLV_TAG); extensionTagNum = TagNumFromTag(tlvTag); if (extensionTagNum == kTag_FutureExtension) { - err = DecodeConvertFutureExtension(reader, writer, certData); - SuccessOrExit(err); + ReturnErrorOnFailure(DecodeConvertFutureExtension(reader, writer, certData)); } else { // Extension ::= SEQUENCE ASN1_START_SEQUENCE { - extensionOID = GetOID(kOIDCategory_Extension, static_cast(extensionTagNum)); - // extnID OBJECT IDENTIFIER, - ASN1_ENCODE_OBJECT_ID(extensionOID); + ASN1_ENCODE_OBJECT_ID(GetOID(kOIDCategory_Extension, static_cast(extensionTagNum))); // BasicConstraints, KeyUsage and ExtKeyUsage extensions MUST be marked as critical. if (extensionTagNum == kTag_KeyUsage || extensionTagNum == kTag_BasicConstraints || @@ -602,29 +500,28 @@ static CHIP_ERROR DecodeConvertExtension(TLVReader & reader, ASN1Writer & writer { if (extensionTagNum == kTag_AuthorityKeyIdentifier) { - err = DecodeConvertAuthorityKeyIdentifierExtension(reader, writer, certData); + ReturnErrorOnFailure(DecodeConvertAuthorityKeyIdentifierExtension(reader, writer, certData)); } else if (extensionTagNum == kTag_SubjectKeyIdentifier) { - err = DecodeConvertSubjectKeyIdentifierExtension(reader, writer, certData); + ReturnErrorOnFailure(DecodeConvertSubjectKeyIdentifierExtension(reader, writer, certData)); } else if (extensionTagNum == kTag_KeyUsage) { - err = DecodeConvertKeyUsageExtension(reader, writer, certData); + ReturnErrorOnFailure(DecodeConvertKeyUsageExtension(reader, writer, certData)); } else if (extensionTagNum == kTag_BasicConstraints) { - err = DecodeConvertBasicConstraintsExtension(reader, writer, certData); + ReturnErrorOnFailure(DecodeConvertBasicConstraintsExtension(reader, writer, certData)); } else if (extensionTagNum == kTag_ExtendedKeyUsage) { - err = DecodeConvertExtendedKeyUsageExtension(reader, writer, certData); + ReturnErrorOnFailure(DecodeConvertExtendedKeyUsageExtension(reader, writer, certData)); } else { - err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT; + return CHIP_ERROR_UNSUPPORTED_CERT_FORMAT; } - SuccessOrExit(err); } ASN1_END_ENCAPSULATED; } @@ -640,11 +537,8 @@ static CHIP_ERROR DecodeConvertExtensions(TLVReader & reader, ASN1Writer & write CHIP_ERROR err; TLVType outerContainer; - err = reader.Next(kTLVType_List, ContextTag(kTag_Extensions)); - SuccessOrExit(err); - - err = reader.EnterContainer(outerContainer); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.Next(kTLVType_List, ContextTag(kTag_Extensions))); + ReturnErrorOnFailure(reader.EnterContainer(outerContainer)); // extensions [3] EXPLICIT Extensions OPTIONAL ASN1_START_CONSTRUCTED(kASN1TagClass_ContextSpecific, 3) @@ -655,21 +549,15 @@ static CHIP_ERROR DecodeConvertExtensions(TLVReader & reader, ASN1Writer & write // Read certificate extension in the List. while ((err = reader.Next()) == CHIP_NO_ERROR) { - err = DecodeConvertExtension(reader, writer, certData); - SuccessOrExit(err); + ReturnErrorOnFailure(DecodeConvertExtension(reader, writer, certData)); } - err = reader.VerifyEndOfContainer(); - SuccessOrExit(err); + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); } ASN1_END_SEQUENCE; } ASN1_END_CONSTRUCTED; - err = reader.VerifyEndOfContainer(); - SuccessOrExit(err); - - err = reader.ExitContainer(outerContainer); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.ExitContainer(outerContainer)); exit: return err; @@ -678,13 +566,7 @@ static CHIP_ERROR DecodeConvertExtensions(TLVReader & reader, ASN1Writer & write CHIP_ERROR DecodeECDSASignature(TLVReader & reader, ChipCertificateData & certData) { ReturnErrorOnFailure(reader.Next(kTLVType_ByteString, ContextTag(kTag_ECDSASignature))); - - VerifyOrReturnError(reader.GetLength() == certData.mSignature.size(), CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); - - const uint8_t * ptr; - ReturnErrorOnFailure(reader.GetDataPtr(ptr)); - certData.mSignature = P256ECDSASignatureSpan(ptr); - + ReturnErrorOnFailure(reader.Get(certData.mSignature)); return CHIP_NO_ERROR; } @@ -732,59 +614,41 @@ CHIP_ERROR DecodeConvertTBSCert(TLVReader & reader, ASN1Writer & writer, ChipCer } ASN1_END_CONSTRUCTED; - err = reader.Next(kTLVType_ByteString, ContextTag(kTag_SerialNumber)); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.Next(kTLVType_ByteString, ContextTag(kTag_SerialNumber))); // serialNumber CertificateSerialNumber // CertificateSerialNumber ::= INTEGER - err = writer.PutValue(kASN1TagClass_Universal, kASN1UniversalTag_Integer, false, reader); - SuccessOrExit(err); + ReturnErrorOnFailure(writer.PutValue(kASN1TagClass_Universal, kASN1UniversalTag_Integer, false, reader)); // signature AlgorithmIdentifier // AlgorithmIdentifier ::= SEQUENCE ASN1_START_SEQUENCE { - uint64_t sigAlgoId; - OID sigAlgoOID; - - err = reader.Next(kTLVType_UnsignedInteger, ContextTag(kTag_SignatureAlgorithm)); - SuccessOrExit(err); - - err = reader.Get(sigAlgoId); - SuccessOrExit(err); + uint8_t sigAlgoId; + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_SignatureAlgorithm))); + ReturnErrorOnFailure(reader.Get(sigAlgoId)); - VerifyOrExit(CanCastTo(sigAlgoId), err = CHIP_ERROR_UNSUPPORTED_CERT_FORMAT); - - sigAlgoOID = GetOID(kOIDCategory_SigAlgo, static_cast(sigAlgoId)); - ASN1_ENCODE_OBJECT_ID(sigAlgoOID); - - certData.mSigAlgoOID = sigAlgoOID; + certData.mSigAlgoOID = GetOID(kOIDCategory_SigAlgo, sigAlgoId); + ASN1_ENCODE_OBJECT_ID(certData.mSigAlgoOID); } ASN1_END_SEQUENCE; // issuer Name - err = reader.Next(kTLVType_List, ContextTag(kTag_Issuer)); - SuccessOrExit(err); - err = DecodeConvertDN(reader, writer, certData.mIssuerDN); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.Next(kTLVType_List, ContextTag(kTag_Issuer))); + ReturnErrorOnFailure(DecodeConvertDN(reader, writer, certData.mIssuerDN)); // validity Validity, - err = DecodeConvertValidity(reader, writer, certData); - SuccessOrExit(err); + ReturnErrorOnFailure(DecodeConvertValidity(reader, writer, certData)); // subject Name - err = reader.Next(kTLVType_List, ContextTag(kTag_Subject)); - SuccessOrExit(err); - err = DecodeConvertDN(reader, writer, certData.mSubjectDN); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.Next(kTLVType_List, ContextTag(kTag_Subject))); + ReturnErrorOnFailure(DecodeConvertDN(reader, writer, certData.mSubjectDN)); // subjectPublicKeyInfo SubjectPublicKeyInfo, - err = DecodeConvertSubjectPublicKeyInfo(reader, writer, certData); - SuccessOrExit(err); + ReturnErrorOnFailure(DecodeConvertSubjectPublicKeyInfo(reader, writer, certData)); // certificate extensions - err = DecodeConvertExtensions(reader, writer, certData); - SuccessOrExit(err); + ReturnErrorOnFailure(DecodeConvertExtensions(reader, writer, certData)); } ASN1_END_SEQUENCE; @@ -799,21 +663,18 @@ static CHIP_ERROR DecodeConvertCert(TLVReader & reader, ASN1Writer & writer, Chi if (reader.GetType() == kTLVType_NotSpecified) { - err = reader.Next(); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.Next()); } - VerifyOrExit(reader.GetType() == kTLVType_Structure, err = CHIP_ERROR_WRONG_TLV_TYPE); - VerifyOrExit(reader.GetTag() == AnonymousTag, err = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + VerifyOrReturnError(reader.GetType() == kTLVType_Structure, CHIP_ERROR_WRONG_TLV_TYPE); + VerifyOrReturnError(reader.GetTag() == AnonymousTag, CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); - err = reader.EnterContainer(containerType); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.EnterContainer(containerType)); // Certificate ::= SEQUENCE ASN1_START_SEQUENCE { // tbsCertificate TBSCertificate, - err = DecodeConvertTBSCert(reader, writer, certData); - SuccessOrExit(err); + ReturnErrorOnFailure(DecodeConvertTBSCert(reader, writer, certData)); // signatureAlgorithm AlgorithmIdentifier // AlgorithmIdentifier ::= SEQUENCE @@ -821,17 +682,13 @@ static CHIP_ERROR DecodeConvertCert(TLVReader & reader, ASN1Writer & writer, Chi ASN1_END_SEQUENCE; // signatureValue BIT STRING - err = DecodeConvertECDSASignature(reader, writer, certData); - SuccessOrExit(err); + ReturnErrorOnFailure(DecodeConvertECDSASignature(reader, writer, certData)); } ASN1_END_SEQUENCE; // Verify no more elements in certificate. - err = reader.VerifyEndOfContainer(); - SuccessOrExit(err); - - err = reader.ExitContainer(containerType); - SuccessOrExit(err); + ReturnErrorOnFailure(reader.VerifyEndOfContainer()); + ReturnErrorOnFailure(reader.ExitContainer(containerType)); exit: return err; diff --git a/src/credentials/CertificationDeclaration.cpp b/src/credentials/CertificationDeclaration.cpp index 7c3bef2b349480..5d64230673250a 100644 --- a/src/credentials/CertificationDeclaration.cpp +++ b/src/credentials/CertificationDeclaration.cpp @@ -48,14 +48,17 @@ static constexpr uint8_t sOID_SigAlgo_ECDSAWithSHA256[] = { 0x2A, 0x86, 0x48 */ enum { - kTag_VendorId = 1, /**< [ unsigned int ] Vedor identifier. */ - kTag_ProductIds = 2, /**< [ array ] Product identifiers (each is unsigned int). */ - kTag_ServerCategoryId = 3, /**< [ unsigned int ] Server category identifier. */ - kTag_ClientCategoryId = 4, /**< [ unsigned int ] Client category identifier. */ - kTag_SecurityLevel = 5, /**< [ unsigned int ] Security level. */ - kTag_SecurityInformation = 6, /**< [ unsigned int ] Security information. */ - kTag_VersionNumber = 7, /**< [ unsigned int ] Version number. */ - kTag_CertificationType = 8, /**< [ unsigned int ] Certification Type. */ + kTag_FormatVersion = 0, /**< [ unsigned int ] Format version. */ + kTag_VendorId = 1, /**< [ unsigned int ] Vedor identifier. */ + kTag_ProductIdArray = 2, /**< [ array ] Product identifiers (each is unsigned int). */ + kTag_DeviceTypeId = 3, /**< [ unsigned int ] Device Type identifier. */ + kTag_CertificateId = 4, /**< [ UTF-8 string, length 19 ] Certificate identifier. */ + kTag_SecurityLevel = 5, /**< [ unsigned int ] Security level. */ + kTag_SecurityInformation = 6, /**< [ unsigned int ] Security information. */ + kTag_VersionNumber = 7, /**< [ unsigned int ] Version number. */ + kTag_CertificationType = 8, /**< [ unsigned int ] Certification Type. */ + kTag_DACOriginVendorId = 9, /**< [ unsigned int, optional ] DAC origin vendor identifier. */ + kTag_DACOriginProductId = 10, /**< [ unsigned int, optional ] DAC origin product identifier. */ }; CHIP_ERROR EncodeCertificationElements(const CertificationElements & certElements, MutableByteSpan & encodedCertElements) @@ -67,25 +70,30 @@ CHIP_ERROR EncodeCertificationElements(const CertificationElements & certElement ReturnErrorOnFailure(writer.StartContainer(AnonymousTag, kTLVType_Structure, outerContainer1)); + ReturnErrorOnFailure(writer.Put(ContextTag(kTag_FormatVersion), certElements.FormatVersion)); ReturnErrorOnFailure(writer.Put(ContextTag(kTag_VendorId), certElements.VendorId)); VerifyOrReturnError(certElements.ProductIdsCount > 0, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(certElements.ProductIdsCount < kMaxProductIdsCountPerCD, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(certElements.ProductIdsCount <= kMaxProductIdsCountPerCD, CHIP_ERROR_INVALID_ARGUMENT); - ReturnErrorOnFailure(writer.StartContainer(ContextTag(kTag_ProductIds), kTLVType_Array, outerContainer2)); + ReturnErrorOnFailure(writer.StartContainer(ContextTag(kTag_ProductIdArray), kTLVType_Array, outerContainer2)); for (uint8_t i = 0; i < certElements.ProductIdsCount; i++) { ReturnErrorOnFailure(writer.Put(AnonymousTag, certElements.ProductIds[i])); } ReturnErrorOnFailure(writer.EndContainer(outerContainer2)); - ReturnErrorOnFailure(writer.Put(ContextTag(kTag_ServerCategoryId), certElements.ServerCategoryId)); - ReturnErrorOnFailure(writer.Put(ContextTag(kTag_ClientCategoryId), certElements.ClientCategoryId)); + ReturnErrorOnFailure(writer.Put(ContextTag(kTag_DeviceTypeId), certElements.DeviceTypeId)); + ReturnErrorOnFailure(writer.PutString(ContextTag(kTag_CertificateId), certElements.CertificateId)); ReturnErrorOnFailure(writer.Put(ContextTag(kTag_SecurityLevel), certElements.SecurityLevel)); ReturnErrorOnFailure(writer.Put(ContextTag(kTag_SecurityInformation), certElements.SecurityInformation)); ReturnErrorOnFailure(writer.Put(ContextTag(kTag_VersionNumber), certElements.VersionNumber)); ReturnErrorOnFailure(writer.Put(ContextTag(kTag_CertificationType), certElements.CertificationType)); - + if (certElements.DACOriginVIDandPIDPresent) + { + ReturnErrorOnFailure(writer.Put(ContextTag(kTag_DACOriginVendorId), certElements.DACOriginVendorId)); + ReturnErrorOnFailure(writer.Put(ContextTag(kTag_DACOriginProductId), certElements.DACOriginProductId)); + } ReturnErrorOnFailure(writer.EndContainer(outerContainer1)); ReturnErrorOnFailure(writer.Finalize()); @@ -97,9 +105,9 @@ CHIP_ERROR EncodeCertificationElements(const CertificationElements & certElement CHIP_ERROR DecodeCertificationElements(const ByteSpan & encodedCertElements, CertificationElements & certElements) { + CHIP_ERROR err; TLVReader reader; TLVType outerContainer1, outerContainer2; - uint64_t element; reader.Init(encodedCertElements); @@ -107,55 +115,57 @@ CHIP_ERROR DecodeCertificationElements(const ByteSpan & encodedCertElements, Cer ReturnErrorOnFailure(reader.EnterContainer(outerContainer1)); - ReturnErrorOnFailure(reader.Next(kTLVType_UnsignedInteger, ContextTag(kTag_VendorId))); - ReturnErrorOnFailure(reader.Get(element)); - VerifyOrReturnError(CanCastTo(element), CHIP_ERROR_INVALID_TLV_ELEMENT); - certElements.VendorId = static_cast(element); + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_FormatVersion))); + ReturnErrorOnFailure(reader.Get(certElements.FormatVersion)); - ReturnErrorOnFailure(reader.Next(kTLVType_Array, ContextTag(kTag_ProductIds))); + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_VendorId))); + ReturnErrorOnFailure(reader.Get(certElements.VendorId)); + + ReturnErrorOnFailure(reader.Next(kTLVType_Array, ContextTag(kTag_ProductIdArray))); ReturnErrorOnFailure(reader.EnterContainer(outerContainer2)); certElements.ProductIdsCount = 0; - while (reader.Next(kTLVType_UnsignedInteger, AnonymousTag) == CHIP_NO_ERROR) + while ((err = reader.Next(AnonymousTag)) == CHIP_NO_ERROR) { - ReturnErrorOnFailure(reader.Get(element)); - VerifyOrReturnError(CanCastTo(element), CHIP_ERROR_INVALID_TLV_ELEMENT); - certElements.ProductIds[certElements.ProductIdsCount++] = static_cast(element); + ReturnErrorOnFailure(reader.Get(certElements.ProductIds[certElements.ProductIdsCount++])); } - ReturnErrorOnFailure(reader.VerifyEndOfContainer()); + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outerContainer2)); - ReturnErrorOnFailure(reader.Next(kTLVType_UnsignedInteger, ContextTag(kTag_ServerCategoryId))); - ReturnErrorOnFailure(reader.Get(element)); - VerifyOrReturnError(CanCastTo(element), CHIP_ERROR_INVALID_TLV_ELEMENT); - certElements.ServerCategoryId = static_cast(element); + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_DeviceTypeId))); + ReturnErrorOnFailure(reader.Get(certElements.DeviceTypeId)); - ReturnErrorOnFailure(reader.Next(kTLVType_UnsignedInteger, ContextTag(kTag_ClientCategoryId))); - ReturnErrorOnFailure(reader.Get(element)); - VerifyOrReturnError(CanCastTo(element), CHIP_ERROR_INVALID_TLV_ELEMENT); - certElements.ClientCategoryId = static_cast(element); + ReturnErrorOnFailure(reader.Next(kTLVType_UTF8String, ContextTag(kTag_CertificateId))); + ReturnErrorOnFailure(reader.GetString(certElements.CertificateId, sizeof(certElements.CertificateId))); + VerifyOrReturnError(strlen(certElements.CertificateId) == kCertificateIdLength, CHIP_ERROR_INVALID_TLV_ELEMENT); - ReturnErrorOnFailure(reader.Next(kTLVType_UnsignedInteger, ContextTag(kTag_SecurityLevel))); - ReturnErrorOnFailure(reader.Get(element)); - VerifyOrReturnError(CanCastTo(element), CHIP_ERROR_INVALID_TLV_ELEMENT); - certElements.SecurityLevel = static_cast(element); + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_SecurityLevel))); + ReturnErrorOnFailure(reader.Get(certElements.SecurityLevel)); - ReturnErrorOnFailure(reader.Next(kTLVType_UnsignedInteger, ContextTag(kTag_SecurityInformation))); - ReturnErrorOnFailure(reader.Get(element)); - VerifyOrReturnError(CanCastTo(element), CHIP_ERROR_INVALID_TLV_ELEMENT); - certElements.SecurityInformation = static_cast(element); + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_SecurityInformation))); + ReturnErrorOnFailure(reader.Get(certElements.SecurityInformation)); - ReturnErrorOnFailure(reader.Next(kTLVType_UnsignedInteger, ContextTag(kTag_VersionNumber))); - ReturnErrorOnFailure(reader.Get(element)); - VerifyOrReturnError(CanCastTo(element), CHIP_ERROR_INVALID_TLV_ELEMENT); - certElements.VersionNumber = static_cast(element); + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_VersionNumber))); + ReturnErrorOnFailure(reader.Get(certElements.VersionNumber)); - ReturnErrorOnFailure(reader.Next(kTLVType_UnsignedInteger, ContextTag(kTag_CertificationType))); - ReturnErrorOnFailure(reader.Get(element)); - VerifyOrReturnError(CanCastTo(element), CHIP_ERROR_INVALID_TLV_ELEMENT); - certElements.CertificationType = static_cast(element); + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_CertificationType))); + ReturnErrorOnFailure(reader.Get(certElements.CertificationType)); - ReturnErrorOnFailure(reader.VerifyEndOfContainer()); + certElements.DACOriginVIDandPIDPresent = false; + + // If kTag_DACOriginVendorId present then kTag_DACOriginProductId must be present. + if ((err = reader.Next(ContextTag(kTag_DACOriginVendorId))) == CHIP_NO_ERROR) + { + ReturnErrorOnFailure(reader.Get(certElements.DACOriginVendorId)); + + ReturnErrorOnFailure(reader.Next(ContextTag(kTag_DACOriginProductId))); + ReturnErrorOnFailure(reader.Get(certElements.DACOriginProductId)); + + certElements.DACOriginVIDandPIDPresent = true; + + err = reader.Next(); + } + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); ReturnErrorOnFailure(reader.ExitContainer(outerContainer1)); diff --git a/src/credentials/CertificationDeclaration.h b/src/credentials/CertificationDeclaration.h index 2dbe72617d4bf7..0552a90676d69f 100644 --- a/src/credentials/CertificationDeclaration.h +++ b/src/credentials/CertificationDeclaration.h @@ -34,25 +34,32 @@ namespace chip { namespace Credentials { static constexpr uint32_t kMaxProductIdsCountPerCD = 100; +static constexpr uint32_t kCertificateIdLength = 19; +// TODO: share code with EstimateTLVStructOverhead to estimate TLV structure size. static constexpr uint32_t kCertificationElements_TLVEncodedMaxLength = (1 + 1) + // Length of header and end of outer TLV structure. + (3 + kCertificateIdLength) + // Encoded length of CertificateId string. (1 + sizeof(uint16_t)) * kMaxProductIdsCountPerCD + 3 + // Max encoding length of an array of 100 uint16_t elements. (2 + sizeof(uint8_t)) * 2 + // Encoding length of two uint8_t element. - (2 + sizeof(uint16_t)) * 5; // Max total encoding length of five uint16_t elements. + (2 + sizeof(uint16_t)) * 7; // Max total encoding length of seven uint16_t elements. static constexpr uint32_t kMaxCMSSignedCDMessage = 183 + kCertificationElements_TLVEncodedMaxLength; struct CertificationElements { + uint16_t FormatVersion; uint16_t VendorId; uint16_t ProductIds[kMaxProductIdsCountPerCD]; uint8_t ProductIdsCount; - uint16_t ServerCategoryId; - uint16_t ClientCategoryId; + uint16_t DeviceTypeId; + char CertificateId[kCertificateIdLength + 1]; uint8_t SecurityLevel; uint16_t SecurityInformation; uint16_t VersionNumber; uint8_t CertificationType; + uint16_t DACOriginVendorId; + uint16_t DACOriginProductId; + bool DACOriginVIDandPIDPresent; }; /** diff --git a/src/credentials/GroupDataProvider.h b/src/credentials/GroupDataProvider.h index 89363c57074e45..d4bf7092a3302e 100644 --- a/src/credentials/GroupDataProvider.h +++ b/src/credentials/GroupDataProvider.h @@ -20,6 +20,7 @@ #include #include #include +#include namespace chip { namespace Credentials { @@ -198,6 +199,9 @@ class GroupDataProvider // Fabrics virtual CHIP_ERROR RemoveFabric(chip::FabricIndex fabric_index) = 0; + // General + virtual CHIP_ERROR Decrypt(PacketHeader packetHeader, PayloadHeader & payloadHeader, System::PacketBufferHandle && msg) = 0; + // Listener void SetListener(GroupListener * listener) { mListener = listener; }; void RemoveListener() { mListener = nullptr; }; diff --git a/src/credentials/examples/GroupDataProviderExample.cpp b/src/credentials/examples/GroupDataProviderExample.cpp index 0706c52fc55c81..267cbc4607e7a7 100644 --- a/src/credentials/examples/GroupDataProviderExample.cpp +++ b/src/credentials/examples/GroupDataProviderExample.cpp @@ -657,6 +657,13 @@ class StaticGroupsProvider : public GroupDataProvider return CHIP_NO_ERROR; } + CHIP_ERROR Decrypt(PacketHeader packetHeader, PayloadHeader & payloadHeader, System::PacketBufferHandle && msg) override + { + // TODO + + return CHIP_NO_ERROR; + } + private: bool mInitialized = false; Fabric mFabrics[kNumFabrics]; diff --git a/src/credentials/tests/TestCertificationDeclaration.cpp b/src/credentials/tests/TestCertificationDeclaration.cpp index 85dfe90a2d2d93..844d81b5cd44be 100644 --- a/src/credentials/tests/TestCertificationDeclaration.cpp +++ b/src/credentials/tests/TestCertificationDeclaration.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -37,195 +38,282 @@ using namespace chip::Crypto; using namespace chip::Credentials; static constexpr uint8_t sTestCMS_SignerCert[] = { - 0x30, 0x82, 0x01, 0xa7, 0x30, 0x82, 0x01, 0x4d, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x74, 0x1f, 0x94, 0x28, 0x05, 0x8f, - 0x11, 0xa6, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x26, 0x31, 0x24, 0x30, 0x22, 0x06, - 0x03, 0x55, 0x04, 0x03, 0x0c, 0x1b, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x44, 0x20, - 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x20, 0x17, 0x0d, 0x32, 0x31, 0x30, 0x36, 0x32, - 0x38, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x18, 0x0f, 0x39, 0x39, 0x39, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, - 0x39, 0x35, 0x39, 0x5a, 0x30, 0x26, 0x31, 0x24, 0x30, 0x22, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x1b, 0x4d, 0x61, 0x74, 0x74, - 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x44, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x20, 0x52, 0x6f, - 0x6f, 0x74, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, - 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xd7, 0x35, 0x94, 0xc9, 0x7b, 0xb4, 0x7c, 0xb4, 0x35, 0x8b, 0xa5, 0x8e, 0xf9, - 0x6f, 0x80, 0x49, 0xcb, 0xc8, 0x14, 0xb5, 0xdb, 0xd3, 0x1a, 0xe4, 0x73, 0xd5, 0x57, 0x74, 0x77, 0x55, 0xed, 0xa1, 0xd7, 0x54, - 0x7a, 0xe6, 0x0f, 0xaa, 0xa3, 0xd3, 0xc7, 0x2d, 0xbe, 0x44, 0x73, 0xab, 0x3b, 0x72, 0x08, 0x6d, 0xe5, 0x12, 0x2b, 0x2a, 0x63, - 0x72, 0x4e, 0xfe, 0x9b, 0xdb, 0x84, 0xdb, 0x92, 0xe4, 0xa3, 0x63, 0x30, 0x61, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, - 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, - 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xfd, 0x03, 0xc3, 0x49, 0xfc, 0x32, - 0x9e, 0x6c, 0xef, 0xf0, 0x1b, 0xa7, 0x7f, 0x6b, 0x8a, 0x31, 0xfb, 0xc0, 0xe7, 0xd4, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, - 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xfd, 0x03, 0xc3, 0x49, 0xfc, 0x32, 0x9e, 0x6c, 0xef, 0xf0, 0x1b, 0xa7, 0x7f, 0x6b, 0x8a, - 0x31, 0xfb, 0xc0, 0xe7, 0xd4, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, - 0x45, 0x02, 0x20, 0x19, 0x02, 0xe4, 0xce, 0x75, 0x91, 0x8b, 0x25, 0xff, 0xbb, 0xb5, 0x1c, 0x80, 0x13, 0x6f, 0xd8, 0x65, 0x71, - 0x10, 0x42, 0x23, 0x85, 0x5a, 0x6c, 0x8a, 0x95, 0x8f, 0xf5, 0x47, 0x17, 0x07, 0x11, 0x02, 0x21, 0x00, 0xc3, 0x2b, 0x9c, 0x0d, - 0x15, 0x5b, 0x4e, 0xf5, 0x0c, 0xa0, 0xf2, 0x25, 0x34, 0x13, 0xaa, 0x24, 0xcc, 0xc6, 0xbd, 0x97, 0xed, 0xea, 0x31, 0x75, 0x80, - 0x52, 0x2d, 0x26, 0xf1, 0xc1, 0x9b, 0x93 + 0x30, 0x82, 0x01, 0xb3, 0x30, 0x82, 0x01, 0x5a, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x45, 0xda, 0xf3, 0x9d, 0xe4, 0x7a, + 0xa0, 0x8f, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x2b, 0x31, 0x29, 0x30, 0x27, 0x06, + 0x03, 0x55, 0x04, 0x03, 0x0c, 0x20, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x44, 0x20, + 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x20, 0x17, 0x0d, + 0x32, 0x31, 0x30, 0x36, 0x32, 0x38, 0x31, 0x34, 0x32, 0x33, 0x34, 0x33, 0x5a, 0x18, 0x0f, 0x39, 0x39, 0x39, 0x39, 0x31, 0x32, + 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x2b, 0x31, 0x29, 0x30, 0x27, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, + 0x20, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, 0x43, 0x44, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x69, + 0x6e, 0x67, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, + 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x3c, 0x39, 0x89, + 0x22, 0x45, 0x2b, 0x55, 0xca, 0xf3, 0x89, 0xc2, 0x5b, 0xd1, 0xbc, 0xa4, 0x65, 0x69, 0x52, 0xcc, 0xb9, 0x0e, 0x88, 0x69, 0x24, + 0x9a, 0xd8, 0x47, 0x46, 0x53, 0x01, 0x4c, 0xbf, 0x95, 0xd6, 0x87, 0x96, 0x5e, 0x03, 0x6b, 0x52, 0x1c, 0x51, 0x03, 0x7e, 0x6b, + 0x8c, 0xed, 0xef, 0xca, 0x1e, 0xb4, 0x40, 0x46, 0x69, 0x4f, 0xa0, 0x88, 0x82, 0xee, 0xd6, 0x51, 0x9d, 0xec, 0xba, 0xa3, 0x66, + 0x30, 0x64, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, + 0x01, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, + 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, + 0xdd, 0xf5, 0x04, 0xf3, 0x71, 0x60, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x62, 0xfa, + 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, 0xf5, 0x04, 0xf3, 0x71, 0x60, 0x30, 0x0a, 0x06, + 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20, 0x2c, 0x54, 0x5c, 0xe4, 0xe4, + 0x57, 0xd8, 0xa6, 0xf0, 0xd9, 0xd9, 0xbb, 0xeb, 0xd6, 0xec, 0xe1, 0xdd, 0xfe, 0x7f, 0x8c, 0x6d, 0x9a, 0x6c, 0xf3, 0x75, 0x32, + 0x1f, 0xc6, 0xfa, 0xc7, 0x13, 0x84, 0x02, 0x20, 0x54, 0x07, 0x78, 0xe8, 0x74, 0x39, 0x72, 0x52, 0x7e, 0xed, 0xeb, 0xaf, 0x58, + 0x68, 0x62, 0x20, 0xb5, 0x40, 0x78, 0xf2, 0xcd, 0x4e, 0x62, 0xa7, 0x6a, 0xe7, 0xcb, 0xb9, 0x2f, 0xf5, 0x4c, 0x8b, }; -static constexpr uint8_t sTestCMS_SignedMessage[] = { - 0x30, 0x81, 0xDB, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x02, 0xA0, 0x81, 0xCD, 0x30, 0x81, 0xCA, 0x02, - 0x01, 0x03, 0x31, 0x0D, 0x30, 0x0B, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x37, 0x06, 0x09, - 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0xA0, 0x2A, 0x04, 0x28, 0x15, 0x25, 0x01, 0xF1, 0xFF, 0x36, 0x02, 0x05, - 0x00, 0x80, 0x05, 0x01, 0x80, 0x05, 0x02, 0x80, 0x18, 0x25, 0x03, 0xD2, 0x04, 0x25, 0x04, 0x2E, 0x16, 0x24, 0x05, 0xAA, 0x25, - 0x06, 0xDE, 0xC0, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18, 0x31, 0x7D, 0x30, 0x7B, 0x02, 0x01, 0x03, 0x80, 0x14, 0xFD, - 0x03, 0xC3, 0x49, 0xFC, 0x32, 0x9E, 0x6C, 0xEF, 0xF0, 0x1B, 0xA7, 0x7F, 0x6B, 0x8A, 0x31, 0xFB, 0xC0, 0xE7, 0xD4, 0x30, 0x0B, - 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, - 0x03, 0x02, 0x04, 0x47, 0x30, 0x45, 0x02, 0x21, 0x00, 0x88, 0x16, 0xB6, 0x1E, 0x5B, 0x43, 0x90, 0x00, 0xA7, 0x42, 0x07, 0xB2, - 0x6A, 0xBB, 0x0A, 0xB6, 0x6C, 0xAA, 0xCB, 0xDD, 0x05, 0x08, 0xE8, 0xE3, 0xE2, 0xC6, 0xAB, 0x0F, 0x41, 0x29, 0x73, 0xCE, 0x02, - 0x20, 0x0C, 0x09, 0xED, 0x4F, 0x05, 0x43, 0x10, 0x17, 0xA9, 0xC4, 0xB5, 0x00, 0x5F, 0x23, 0x49, 0x25, 0x01, 0x2D, 0xAB, 0x56, - 0x34, 0x75, 0xE4, 0x7D, 0x0C, 0x82, 0x42, 0xF7, 0xAD, 0x21, 0xA1, 0xFF +static constexpr uint8_t sTestCMS_SignerPublicKey[] = { 0x04, 0x3c, 0x39, 0x89, 0x22, 0x45, 0x2b, 0x55, 0xca, 0xf3, 0x89, + 0xc2, 0x5b, 0xd1, 0xbc, 0xa4, 0x65, 0x69, 0x52, 0xcc, 0xb9, 0x0e, + 0x88, 0x69, 0x24, 0x9a, 0xd8, 0x47, 0x46, 0x53, 0x01, 0x4c, 0xbf, + 0x95, 0xd6, 0x87, 0x96, 0x5e, 0x03, 0x6b, 0x52, 0x1c, 0x51, 0x03, + 0x7e, 0x6b, 0x8c, 0xed, 0xef, 0xca, 0x1e, 0xb4, 0x40, 0x46, 0x69, + 0x4f, 0xa0, 0x88, 0x82, 0xee, 0xd6, 0x51, 0x9d, 0xec, 0xba }; + +static constexpr uint8_t sTestCMS_SignerSerializedKeypair[] = { + 0x04, 0x3c, 0x39, 0x89, 0x22, 0x45, 0x2b, 0x55, 0xca, 0xf3, 0x89, 0xc2, 0x5b, 0xd1, 0xbc, 0xa4, 0x65, 0x69, 0x52, 0xcc, + 0xb9, 0x0e, 0x88, 0x69, 0x24, 0x9a, 0xd8, 0x47, 0x46, 0x53, 0x01, 0x4c, 0xbf, 0x95, 0xd6, 0x87, 0x96, 0x5e, 0x03, 0x6b, + 0x52, 0x1c, 0x51, 0x03, 0x7e, 0x6b, 0x8c, 0xed, 0xef, 0xca, 0x1e, 0xb4, 0x40, 0x46, 0x69, 0x4f, 0xa0, 0x88, 0x82, 0xee, + 0xd6, 0x51, 0x9d, 0xec, 0xba, 0xae, 0xf3, 0x48, 0x41, 0x16, 0xe9, 0x48, 0x1e, 0xc5, 0x7b, 0xe0, 0x47, 0x2d, 0xf4, 0x1b, + 0xf4, 0x99, 0x06, 0x4e, 0x50, 0x24, 0xad, 0x86, 0x9e, 0xca, 0x5e, 0x88, 0x98, 0x02, 0xd4, 0x80, 0x75 }; -static constexpr uint8_t sTestCMS_CDContent[] = { 0x15, 0x25, 0x01, 0xF1, 0xFF, 0x36, 0x02, 0x05, 0x00, 0x80, - 0x05, 0x01, 0x80, 0x05, 0x02, 0x80, 0x18, 0x25, 0x03, 0xD2, - 0x04, 0x25, 0x04, 0x2E, 0x16, 0x24, 0x05, 0xAA, 0x25, 0x06, - 0xDE, 0xC0, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18 }; - -static constexpr uint8_t sTestCMS_SignerKeyId[] = { 0xfd, 0x03, 0xc3, 0x49, 0xfc, 0x32, 0x9e, 0x6c, 0xef, 0xf0, - 0x1b, 0xa7, 0x7f, 0x6b, 0x8a, 0x31, 0xfb, 0xc0, 0xe7, 0xd4 }; - -// The value of the private key is: -// 0xbb, 0xd0, 0xe5, 0xa9, 0x97, 0x99, 0x50, 0xa6, 0x1a, 0xe5, 0xfe, 0xa8, 0xcc, 0x5d, 0xbc, 0x2c, -// 0xb0, 0xa4, 0x3f, 0xed, 0xcf, 0xfa, 0x2b, 0x68, 0xe3, 0x09, 0x4a, 0xf1, 0x00, 0x1c, 0xee, 0x41 -static constexpr uint8_t sTestCMS_SerializedKeypair[] = { - 0x04, 0xd7, 0x35, 0x94, 0xc9, 0x7b, 0xb4, 0x7c, 0xb4, 0x35, 0x8b, 0xa5, 0x8e, 0xf9, 0x6f, 0x80, 0x49, 0xcb, 0xc8, 0x14, - 0xb5, 0xdb, 0xd3, 0x1a, 0xe4, 0x73, 0xd5, 0x57, 0x74, 0x77, 0x55, 0xed, 0xa1, 0xd7, 0x54, 0x7a, 0xe6, 0x0f, 0xaa, 0xa3, - 0xd3, 0xc7, 0x2d, 0xbe, 0x44, 0x73, 0xab, 0x3b, 0x72, 0x08, 0x6d, 0xe5, 0x12, 0x2b, 0x2a, 0x63, 0x72, 0x4e, 0xfe, 0x9b, - 0xdb, 0x84, 0xdb, 0x92, 0xe4, 0xbb, 0xd0, 0xe5, 0xa9, 0x97, 0x99, 0x50, 0xa6, 0x1a, 0xe5, 0xfe, 0xa8, 0xcc, 0x5d, 0xbc, - 0x2c, 0xb0, 0xa4, 0x3f, 0xed, 0xcf, 0xfa, 0x2b, 0x68, 0xe3, 0x09, 0x4a, 0xf1, 0x00, 0x1c, 0xee, 0x41 +// First set of test vectors for the following set of CD parameters: +// -> format_version = 1 +// -> vendor_id = 0xFFF1 +// -> product_id_array = [ 0x8000 ] +// -> device_type_id = 0x1234 +// -> certificate_id = "ZIG20141ZB330001-24" +// -> security_level = 0 +// -> security_information = 0 +// -> version_number = 0x2694 +// -> certification_type = 0 +// -> dac_origin_vendor_id is not present +// -> dac_origin_product_id is not present +static constexpr CertificationElements sTestCMS_CertElements01 = { 1, 0xFFF1, { 0x8000 }, 1, 0x1234, "ZIG20141ZB330001-24", + 0, 0, 0x2694, 0, 0, 0, + false }; + +static constexpr uint8_t sTestCMS_CDContent01[] = { 0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf1, 0xff, 0x36, 0x02, 0x05, + 0x00, 0x80, 0x18, 0x25, 0x03, 0x34, 0x12, 0x2c, 0x04, 0x13, 0x5a, + 0x49, 0x47, 0x32, 0x30, 0x31, 0x34, 0x31, 0x5a, 0x42, 0x33, 0x33, + 0x30, 0x30, 0x30, 0x31, 0x2d, 0x32, 0x34, 0x24, 0x05, 0x00, 0x24, + 0x06, 0x00, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18 }; + +static constexpr uint8_t sTestCMS_SignedMessage01[] = { + 0x30, 0x81, 0xe8, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x81, 0xda, 0x30, 0x81, 0xd7, + 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x45, + 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x38, 0x04, 0x36, 0x15, 0x24, 0x00, 0x01, 0x25, + 0x01, 0xf1, 0xff, 0x36, 0x02, 0x05, 0x00, 0x80, 0x18, 0x25, 0x03, 0x34, 0x12, 0x2c, 0x04, 0x13, 0x5a, 0x49, 0x47, 0x32, + 0x30, 0x31, 0x34, 0x31, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x31, 0x2d, 0x32, 0x34, 0x24, 0x05, 0x00, 0x24, 0x06, + 0x00, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18, 0x31, 0x7c, 0x30, 0x7a, 0x02, 0x01, 0x03, 0x80, 0x14, 0x62, 0xfa, + 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, 0xf5, 0x04, 0xf3, 0x71, 0x60, 0x30, 0x0b, + 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x04, 0x03, 0x02, 0x04, 0x46, 0x30, 0x44, 0x02, 0x20, 0x43, 0xa6, 0x3f, 0x2b, 0x94, 0x3d, 0xf3, 0x3c, 0x38, 0xb3, 0xe0, + 0x2f, 0xca, 0xa7, 0x5f, 0xe3, 0x53, 0x2a, 0xeb, 0xbf, 0x5e, 0x63, 0xf5, 0xbb, 0xdb, 0xc0, 0xb1, 0xf0, 0x1d, 0x3c, 0x4f, + 0x60, 0x02, 0x20, 0x4c, 0x1a, 0xbf, 0x5f, 0x18, 0x07, 0xb8, 0x18, 0x94, 0xb1, 0x57, 0x6c, 0x47, 0xe4, 0x72, 0x4e, 0x4d, + 0x96, 0x6c, 0x61, 0x2e, 0xd3, 0xfa, 0x25, 0xc1, 0x18, 0xc3, 0xf2, 0xb3, 0xf9, 0x03, 0x69 }; -static constexpr uint8_t sTestCMS_SignerPublicKey[] = { 0x04, 0xd7, 0x35, 0x94, 0xc9, 0x7b, 0xb4, 0x7c, 0xb4, 0x35, 0x8b, - 0xa5, 0x8e, 0xf9, 0x6f, 0x80, 0x49, 0xcb, 0xc8, 0x14, 0xb5, 0xdb, - 0xd3, 0x1a, 0xe4, 0x73, 0xd5, 0x57, 0x74, 0x77, 0x55, 0xed, 0xa1, - 0xd7, 0x54, 0x7a, 0xe6, 0x0f, 0xaa, 0xa3, 0xd3, 0xc7, 0x2d, 0xbe, - 0x44, 0x73, 0xab, 0x3b, 0x72, 0x08, 0x6d, 0xe5, 0x12, 0x2b, 0x2a, - 0x63, 0x72, 0x4e, 0xfe, 0x9b, 0xdb, 0x84, 0xdb, 0x92, 0xe4 }; +// First set of test vectors for the following set of CD parameters: +// -> format_version = 1 +// -> vendor_id = 0xFFF2 +// -> product_id_array = [ 0x8001, 0x8002 ] +// -> device_type_id = 0x1234 +// -> certificate_id = "ZIG20142ZB330002-24" +// -> security_level = 0 +// -> security_information = 0 +// -> version_number = 0x2694 +// -> certification_type = 0 +// -> dac_origin_vendor_id = 0xFFF1 +// -> dac_origin_product_id = 0x8000 +static constexpr CertificationElements sTestCMS_CertElements02 = { + 1, 0xFFF2, { 0x8001, 0x8002 }, 2, 0x1234, "ZIG20142ZB330002-24", 0, 0, 0x2694, 0, 0xFFF1, 0x8000, true +}; + +static constexpr uint8_t sTestCMS_CDContent02[] = { 0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf2, 0xff, 0x36, 0x02, 0x05, 0x01, 0x80, + 0x05, 0x02, 0x80, 0x18, 0x25, 0x03, 0x34, 0x12, 0x2c, 0x04, 0x13, 0x5a, 0x49, + 0x47, 0x32, 0x30, 0x31, 0x34, 0x32, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, + 0x32, 0x2d, 0x32, 0x34, 0x24, 0x05, 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x94, + 0x26, 0x24, 0x08, 0x00, 0x25, 0x09, 0xf1, 0xff, 0x25, 0x0a, 0x00, 0x80, 0x18 }; + +static constexpr uint8_t sTestCMS_SignedMessage02[] = { + 0x30, 0x81, 0xf5, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x81, 0xe7, 0x30, 0x81, 0xe4, 0x02, + 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x50, 0x06, 0x09, + 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x43, 0x04, 0x41, 0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf2, 0xff, + 0x36, 0x02, 0x05, 0x01, 0x80, 0x05, 0x02, 0x80, 0x18, 0x25, 0x03, 0x34, 0x12, 0x2c, 0x04, 0x13, 0x5a, 0x49, 0x47, 0x32, 0x30, + 0x31, 0x34, 0x32, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, 0x32, 0x2d, 0x32, 0x34, 0x24, 0x05, 0x00, 0x24, 0x06, 0x00, 0x25, + 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x25, 0x09, 0xf1, 0xff, 0x25, 0x0a, 0x00, 0x80, 0x18, 0x31, 0x7e, 0x30, 0x7c, 0x02, 0x01, + 0x03, 0x80, 0x14, 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, 0xf5, 0x04, 0xf3, + 0x71, 0x60, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, + 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x48, 0x30, 0x46, 0x02, 0x21, 0x00, 0x92, 0x62, 0x96, 0xf7, 0x57, 0x81, 0x58, 0xbe, + 0x7c, 0x45, 0x93, 0x88, 0x33, 0x6c, 0xa7, 0x38, 0x37, 0x66, 0xc9, 0xee, 0xdd, 0x98, 0x55, 0xcb, 0xda, 0x6f, 0x4c, 0xf6, 0xbd, + 0xf4, 0x32, 0x11, 0x02, 0x21, 0x00, 0xe0, 0xdb, 0xf4, 0xa2, 0xbc, 0xec, 0x4e, 0xa2, 0x74, 0xba, 0xf0, 0xde, 0xa2, 0x08, 0xb3, + 0x36, 0x5c, 0x6e, 0xd5, 0x44, 0x08, 0x6d, 0x10, 0x1a, 0xfd, 0xaf, 0x07, 0x9a, 0x2c, 0x23, 0xe0, 0xde +}; -static void TestCertificationElements(nlTestSuite * inSuite, void * inContext) +struct TestCase { - CertificationElements certElementsIn1 = { - 0x4567, { 0xFA23, 0x24, 0xFA25, 0x1234 }, 4, 0x1BC8, 0xFFAA, 0xFF, 0x01, 0xCC44, 0x01 - }; - CertificationElements certElementsOut; + ByteSpan signerCert; + P256PublicKeySpan signerPubkey; + CertificationElements cdElements; + ByteSpan cdContent; + ByteSpan cdCMSSigned; +}; - uint8_t encodedCertElemBuf[kCertificationElements_TLVEncodedMaxLength]; - MutableByteSpan encodedCertElem1Span(encodedCertElemBuf); +static constexpr TestCase sTestCases[] = { + { ByteSpan(sTestCMS_SignerCert), P256PublicKeySpan(sTestCMS_SignerPublicKey), sTestCMS_CertElements01, + ByteSpan(sTestCMS_CDContent01), ByteSpan(sTestCMS_SignedMessage01) }, + { ByteSpan(sTestCMS_SignerCert), P256PublicKeySpan(sTestCMS_SignerPublicKey), sTestCMS_CertElements02, + ByteSpan(sTestCMS_CDContent02), ByteSpan(sTestCMS_SignedMessage02) }, +}; - NL_TEST_ASSERT(inSuite, EncodeCertificationElements(certElementsIn1, encodedCertElem1Span) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, DecodeCertificationElements(encodedCertElem1Span, certElementsOut) == CHIP_NO_ERROR); +static constexpr size_t sNumTestCases = ArraySize(sTestCases); - NL_TEST_ASSERT(inSuite, certElementsOut.VendorId == certElementsIn1.VendorId); - NL_TEST_ASSERT(inSuite, certElementsOut.ProductIdsCount == certElementsIn1.ProductIdsCount); - for (uint8_t i = 0; i < certElementsOut.ProductIdsCount; i++) - { - NL_TEST_ASSERT(inSuite, certElementsOut.ProductIds[i] == certElementsIn1.ProductIds[i]); - } - NL_TEST_ASSERT(inSuite, certElementsOut.ServerCategoryId == certElementsIn1.ServerCategoryId); - NL_TEST_ASSERT(inSuite, certElementsOut.ClientCategoryId == certElementsIn1.ClientCategoryId); - NL_TEST_ASSERT(inSuite, certElementsOut.SecurityLevel == certElementsIn1.SecurityLevel); - NL_TEST_ASSERT(inSuite, certElementsOut.SecurityInformation == certElementsIn1.SecurityInformation); - NL_TEST_ASSERT(inSuite, certElementsOut.VersionNumber == certElementsIn1.VersionNumber); - NL_TEST_ASSERT(inSuite, certElementsOut.CertificationType == certElementsIn1.CertificationType); - - // Test precomputed TLV encoded structure with the following paramenters: - CertificationElements certElementsIn2 = { 0xFFF1, { 0x8000, 0x8001, 0x8002 }, 3, 0x04D2, 0x162E, 0xAA, 0xC0DE, 0x2694, 0x00 }; - ByteSpan encodedCertElem2Span(sTestCMS_CDContent); - - NL_TEST_ASSERT(inSuite, DecodeCertificationElements(encodedCertElem2Span, certElementsOut) == CHIP_NO_ERROR); - - NL_TEST_ASSERT(inSuite, certElementsOut.VendorId == certElementsIn2.VendorId); - NL_TEST_ASSERT(inSuite, certElementsOut.ProductIdsCount == certElementsIn2.ProductIdsCount); - for (uint8_t i = 0; i < certElementsOut.ProductIdsCount; i++) +static void TestCD_EncodeDecode(nlTestSuite * inSuite, void * inContext) +{ + for (size_t i = 0; i < sNumTestCases; i++) { - NL_TEST_ASSERT(inSuite, certElementsOut.ProductIds[i] == certElementsIn2.ProductIds[i]); + const TestCase & testCase = sTestCases[i]; + + uint8_t encodedCertElemBuf[kCertificationElements_TLVEncodedMaxLength]; + MutableByteSpan encodedCDPayload(encodedCertElemBuf); + + NL_TEST_ASSERT(inSuite, EncodeCertificationElements(testCase.cdElements, encodedCDPayload) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, testCase.cdContent.data_equal(encodedCDPayload)); + + CertificationElements decodedElements; + NL_TEST_ASSERT(inSuite, DecodeCertificationElements(encodedCDPayload, decodedElements) == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, decodedElements.FormatVersion == testCase.cdElements.FormatVersion); + NL_TEST_ASSERT(inSuite, decodedElements.VendorId == testCase.cdElements.VendorId); + NL_TEST_ASSERT(inSuite, decodedElements.ProductIdsCount == testCase.cdElements.ProductIdsCount); + for (uint8_t j = 0; j < decodedElements.ProductIdsCount; j++) + { + NL_TEST_ASSERT(inSuite, decodedElements.ProductIds[j] == testCase.cdElements.ProductIds[j]); + } + NL_TEST_ASSERT(inSuite, decodedElements.DeviceTypeId == testCase.cdElements.DeviceTypeId); + NL_TEST_ASSERT(inSuite, + memcmp(decodedElements.CertificateId, testCase.cdElements.CertificateId, kCertificateIdLength) == 0); + NL_TEST_ASSERT(inSuite, decodedElements.SecurityLevel == testCase.cdElements.SecurityLevel); + NL_TEST_ASSERT(inSuite, decodedElements.SecurityInformation == testCase.cdElements.SecurityInformation); + NL_TEST_ASSERT(inSuite, decodedElements.VersionNumber == testCase.cdElements.VersionNumber); + NL_TEST_ASSERT(inSuite, decodedElements.CertificationType == testCase.cdElements.CertificationType); + NL_TEST_ASSERT(inSuite, decodedElements.DACOriginVIDandPIDPresent == testCase.cdElements.DACOriginVIDandPIDPresent); + if (decodedElements.DACOriginVIDandPIDPresent) + { + NL_TEST_ASSERT(inSuite, decodedElements.DACOriginVendorId == testCase.cdElements.DACOriginVendorId); + NL_TEST_ASSERT(inSuite, decodedElements.DACOriginProductId == testCase.cdElements.DACOriginProductId); + } } - NL_TEST_ASSERT(inSuite, certElementsOut.ServerCategoryId == certElementsIn2.ServerCategoryId); - NL_TEST_ASSERT(inSuite, certElementsOut.ClientCategoryId == certElementsIn2.ClientCategoryId); - NL_TEST_ASSERT(inSuite, certElementsOut.SecurityLevel == certElementsIn2.SecurityLevel); - NL_TEST_ASSERT(inSuite, certElementsOut.SecurityInformation == certElementsIn2.SecurityInformation); - NL_TEST_ASSERT(inSuite, certElementsOut.VersionNumber == certElementsIn2.VersionNumber); - NL_TEST_ASSERT(inSuite, certElementsOut.CertificationType == certElementsIn2.CertificationType); +} - MutableByteSpan encodedCertElem3Span(encodedCertElemBuf); - NL_TEST_ASSERT(inSuite, EncodeCertificationElements(certElementsOut, encodedCertElem3Span) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, encodedCertElem3Span.data_equal(encodedCertElem2Span)); +static void TestCD_EncodeDecode_Errors(nlTestSuite * inSuite, void * inContext) +{ + uint8_t encodedCertElemBuf[kCertificationElements_TLVEncodedMaxLength]; + MutableByteSpan encodedCDPayload(encodedCertElemBuf); + NL_TEST_ASSERT(inSuite, EncodeCertificationElements(sTestCMS_CertElements01, encodedCDPayload) == CHIP_NO_ERROR); // Test Encode Error: CHIP_ERROR_BUFFER_TOO_SMALL - encodedCertElem3Span.reduce_size(encodedCertElem3Span.size() - 4); - NL_TEST_ASSERT(inSuite, EncodeCertificationElements(certElementsIn1, encodedCertElem3Span) == CHIP_ERROR_BUFFER_TOO_SMALL); - - // Test Decode Error: CHIP_ERROR_INVALID_TLV_ELEMENT - // manually modified sTestCMS_CDContent[] with larger ServerCategoryId value (4-octet) - uint8_t encodedCertElem4[] = { 0x15, 0x25, 0x01, 0xF1, 0xFF, 0x36, 0x02, 0x05, 0x00, 0x80, 0x05, 0x01, 0x80, 0x05, - 0x02, 0x80, 0x18, 0x26, 0x03, 0xD2, 0x04, 0x01, 0x00, 0x25, 0x04, 0x2E, 0x16, 0x24, - 0x05, 0xAA, 0x25, 0x06, 0xDE, 0xC0, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18 }; + // Provide a smaller buffer as an input. + encodedCDPayload.reduce_size(encodedCDPayload.size() - 4); + NL_TEST_ASSERT(inSuite, EncodeCertificationElements(sTestCMS_CertElements01, encodedCDPayload) == CHIP_ERROR_BUFFER_TOO_SMALL); + + // Test Decode Error: CHIP_ERROR_INVALID_INTEGER_VALUE + // Manually modified sTestCMS_CDContent01[]: updated DeviceTypeId element to 4-octet (0x25, 0x03, 0x34, 0x12, --> 0x26, 0x03, + // 0x34, 0x12, 0xFF, 0xFF,) + static constexpr uint8_t sTestCMS_CDContent01_Err01[] = { + 0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf1, 0xff, 0x36, 0x02, 0x05, 0x00, 0x80, 0x18, 0x26, 0x03, 0x34, 0x12, 0xFF, + 0xFF, 0x2c, 0x04, 0x13, 0x5a, 0x49, 0x47, 0x32, 0x30, 0x31, 0x34, 0x31, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30, + 0x31, 0x2d, 0x32, 0x34, 0x24, 0x05, 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18 + }; - ByteSpan encodedCertElem4Span(encodedCertElem4); - NL_TEST_ASSERT(inSuite, DecodeCertificationElements(encodedCertElem4Span, certElementsOut) == CHIP_ERROR_INVALID_TLV_ELEMENT); + CertificationElements certElementsOut; + NL_TEST_ASSERT(inSuite, + DecodeCertificationElements(ByteSpan(sTestCMS_CDContent01_Err01), certElementsOut) == + CHIP_ERROR_INVALID_INTEGER_VALUE); // Test Decode Error: CHIP_ERROR_UNEXPECTED_TLV_ELEMENT - // manually modified sTestCMS_CDContent[] switched elements order ProductIds <--> ServerCategoryId - uint8_t encodedCertElem5[] = { 0x15, 0x25, 0x01, 0xF1, 0xFF, 0x36, 0x25, 0x03, 0xD2, 0x04, 0x02, 0x05, 0x00, 0x80, - 0x05, 0x01, 0x80, 0x05, 0x02, 0x80, 0x18, 0x25, 0x04, 0x2E, 0x16, 0x24, 0x05, 0xAA, - 0x25, 0x06, 0xDE, 0xC0, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18 }; - ByteSpan encodedCertElem5Span(encodedCertElem5); + // Manually modified sTestCMS_CDContent01[]: switched ProductIds and DeviceTypeId elements tag (0x02 <--> 0x03) + static constexpr uint8_t sTestCMS_CDContent01_Err02[] = { 0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf1, 0xff, 0x36, 0x03, 0x05, + 0x00, 0x80, 0x18, 0x25, 0x02, 0x34, 0x12, 0x2c, 0x04, 0x13, 0x5a, + 0x49, 0x47, 0x32, 0x30, 0x31, 0x34, 0x31, 0x5a, 0x42, 0x33, 0x33, + 0x30, 0x30, 0x30, 0x31, 0x2d, 0x32, 0x34, 0x24, 0x05, 0x00, 0x24, + 0x06, 0x00, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18 }; NL_TEST_ASSERT(inSuite, - DecodeCertificationElements(encodedCertElem5Span, certElementsOut) == CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + DecodeCertificationElements(ByteSpan(sTestCMS_CDContent01_Err02), certElementsOut) == + CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); } -static void TestCMSSignVerify(nlTestSuite * inSuite, void * inContext) +static void TestCD_CMSSignAndVerify(nlTestSuite * inSuite, void * inContext) { - ByteSpan cdContent(sTestCMS_CDContent); + ByteSpan cdContentIn(sTestCMS_CDContent01); ByteSpan cdContentOut; - ByteSpan signerKeyId(sTestCMS_SignerKeyId); + uint8_t signerKeyIdBuf[kKeyIdentifierLength]; + MutableByteSpan signerKeyId(signerKeyIdBuf); uint8_t signedMessageBuf[kMaxCMSSignedCDMessage]; MutableByteSpan signedMessage(signedMessageBuf); + NL_TEST_ASSERT(inSuite, ExtractSKIDFromX509Cert(ByteSpan(sTestCMS_SignerCert), signerKeyId) == CHIP_NO_ERROR); + // Test with random key P256Keypair keypair; NL_TEST_ASSERT(inSuite, keypair.Initialize() == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, CMS_Sign(cdContent, signerKeyId, keypair, signedMessage) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, CMS_Sign(cdContentIn, signerKeyId, keypair, signedMessage) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, CMS_Verify(signedMessage, keypair.Pubkey(), cdContentOut) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, cdContent.data_equal(cdContentOut)); + NL_TEST_ASSERT(inSuite, cdContentIn.data_equal(cdContentOut)); // Test with known key P256Keypair keypair2; P256SerializedKeypair serializedKeypair; - memcpy(serializedKeypair, sTestCMS_SerializedKeypair, sizeof(sTestCMS_SerializedKeypair)); - serializedKeypair.SetLength(sizeof(sTestCMS_SerializedKeypair)); + memcpy(serializedKeypair, sTestCMS_SignerSerializedKeypair, sizeof(sTestCMS_SignerSerializedKeypair)); + serializedKeypair.SetLength(sizeof(sTestCMS_SignerSerializedKeypair)); + cdContentIn = ByteSpan(sTestCMS_CDContent02); signedMessage = MutableByteSpan(signedMessageBuf); NL_TEST_ASSERT(inSuite, keypair2.Deserialize(serializedKeypair) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, CMS_Sign(cdContent, signerKeyId, keypair2, signedMessage) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, CMS_Sign(cdContentIn, signerKeyId, keypair2, signedMessage) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, CMS_Verify(signedMessage, keypair2.Pubkey(), cdContentOut) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, cdContent.data_equal(cdContentOut)); - - // Test known CMS test vector - ByteSpan signedTestMessage(sTestCMS_SignedMessage); - P256PublicKey signerPubkey(sTestCMS_SignerPublicKey); - cdContentOut = ByteSpan(); - NL_TEST_ASSERT(inSuite, CMS_Verify(signedTestMessage, signerPubkey, cdContentOut) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, cdContent.data_equal(cdContentOut)); - - // Test known CMS test vector with X509 Certificate. - ByteSpan signerX509Cert(sTestCMS_SignerCert); - cdContentOut = ByteSpan(); - NL_TEST_ASSERT(inSuite, CMS_Verify(signedTestMessage, signerX509Cert, cdContentOut) == CHIP_NO_ERROR); - - // TestCMS_ExtractCDContent() - cdContentOut = ByteSpan(); - NL_TEST_ASSERT(inSuite, CMS_ExtractCDContent(signedTestMessage, cdContentOut) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, cdContent.data_equal(cdContentOut)); - - // TestCMS_ExtractKeyId() - ByteSpan signerKeyIdOut; - NL_TEST_ASSERT(inSuite, CMS_ExtractKeyId(signedTestMessage, signerKeyIdOut) == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, signerKeyId.data_equal(signerKeyIdOut)); + NL_TEST_ASSERT(inSuite, cdContentIn.data_equal(cdContentOut)); +} + +static void TestCD_CMSVerifyAndExtract(nlTestSuite * inSuite, void * inContext) +{ + for (size_t i = 0; i < sNumTestCases; i++) + { + const TestCase & testCase = sTestCases[i]; + + // Verify using signer P256PublicKey + ByteSpan cdContentOut; + NL_TEST_ASSERT(inSuite, + CMS_Verify(testCase.cdCMSSigned, P256PublicKey(testCase.signerPubkey), cdContentOut) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, testCase.cdContent.data_equal(cdContentOut)); + + // Verify using signer X509 Certificate + cdContentOut = ByteSpan(); + NL_TEST_ASSERT(inSuite, CMS_Verify(testCase.cdCMSSigned, testCase.signerCert, cdContentOut) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, testCase.cdContent.data_equal(cdContentOut)); + + // Test CMS_ExtractCDContent() + cdContentOut = ByteSpan(); + NL_TEST_ASSERT(inSuite, CMS_ExtractCDContent(testCase.cdCMSSigned, cdContentOut) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, testCase.cdContent.data_equal(cdContentOut)); + + // Test CMS_ExtractKeyId() + uint8_t signerKeyIdBuf[kKeyIdentifierLength]; + MutableByteSpan signerKeyId(signerKeyIdBuf); + NL_TEST_ASSERT(inSuite, ExtractSKIDFromX509Cert(testCase.signerCert, signerKeyId) == CHIP_NO_ERROR); + + ByteSpan signerKeyIdOut; + NL_TEST_ASSERT(inSuite, CMS_ExtractKeyId(testCase.cdCMSSigned, signerKeyIdOut) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, signerKeyId.data_equal(signerKeyIdOut)); + } } #define NL_TEST_DEF_FN(fn) NL_TEST_DEF("Test " #fn, fn) /** * Test Suite. It lists all the test functions. */ -static const nlTest sTests[] = { NL_TEST_DEF_FN(TestCertificationElements), NL_TEST_DEF_FN(TestCMSSignVerify), NL_TEST_SENTINEL() }; +static const nlTest sTests[] = { NL_TEST_DEF_FN(TestCD_EncodeDecode), NL_TEST_DEF_FN(TestCD_EncodeDecode_Errors), + NL_TEST_DEF_FN(TestCD_CMSSignAndVerify), NL_TEST_DEF_FN(TestCD_CMSVerifyAndExtract), + NL_TEST_SENTINEL() }; int TestCertificationDeclaration(void) { diff --git a/src/darwin/Framework/CHIP/templates/tests.js b/src/darwin/Framework/CHIP/templates/tests.js index b36006cdeda9bd..410c32582fedb6 100644 --- a/src/darwin/Framework/CHIP/templates/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests.js @@ -57,6 +57,7 @@ function getTests() const OccupancySensing = [ 'Test_TC_OCC_1_1', + 'Test_TC_OCC_2_1', ]; const LevelControl = [ @@ -67,6 +68,12 @@ function getTests() const MediaControl = [ 'Test_TC_MC_1_1', + 'Test_TC_MC_3_6', + 'Test_TC_MC_3_7', + 'Test_TC_MC_3_8', + 'Test_TC_MC_3_9', + 'Test_TC_MC_3_10', + 'Test_TC_MC_3_11', ]; const OnOff = [ @@ -78,10 +85,13 @@ function getTests() const PumpConfigurationControl = [ 'Test_TC_PCC_1_1', 'Test_TC_PCC_2_1', + 'Test_TC_PCC_2_2', + 'Test_TC_PCC_2_3', ]; const RelativeHumidityMeasurement = [ 'Test_TC_RH_1_1', + 'Test_TC_RH_2_1', ]; const TemperatureMeasurement = [ @@ -116,6 +126,7 @@ function getTests() 'TestDelayCommands', 'TestDescriptorCluster', 'TestBasicInformation', + 'TestIdentifyCluster', 'TestOperationalCredentialsCluster', ]; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 8e078a71b903d1..830cee257ffc73 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -1288,6 +1288,16 @@ }); }; +void CHIPTestClusterClusterTestNullableOptionalResponseCallbackBridge::OnSuccessFn( + void * context, bool wasPresent, bool wasNull, uint8_t value) +{ + DispatchSuccess(context, @ { + @"wasPresent" : [NSNumber numberWithBool:wasPresent], + @"wasNull" : [NSNumber numberWithBool:wasNull], + @"value" : [NSNumber numberWithUnsignedChar:value], + }); +}; + void CHIPTestClusterClusterTestSpecificResponseCallbackBridge::OnSuccessFn(void * context, uint8_t returnValue) { DispatchSuccess(context, @ { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index e7185ee87c0a23..4417fad4c5b6c3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -1298,6 +1298,18 @@ class CHIPTestClusterClusterTestListInt8UReverseResponseCallbackBridge static void OnSuccessFn(void * context, /* TYPE WARNING: array array defaults to */ uint8_t * arg1); }; +class CHIPTestClusterClusterTestNullableOptionalResponseCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPTestClusterClusterTestNullableOptionalResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, + keepAlive){}; + + static void OnSuccessFn(void * context, bool wasPresent, bool wasNull, uint8_t value); +}; + class CHIPTestClusterClusterTestSpecificResponseCallbackBridge : public CHIPCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 93a0e97b4c38c7..5ec6f123541ce8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -756,6 +756,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)readAttributeMaxMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeToleranceWithResponseHandler:(ResponseHandler)responseHandler; + - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -1373,6 +1375,12 @@ NS_ASSUME_NONNULL_BEGIN - (void)readAttributeMaxMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeToleranceWithResponseHandler:(ResponseHandler)responseHandler; +- (void)subscribeAttributeToleranceWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeToleranceWithResponseHandler:(ResponseHandler)responseHandler; + - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -1503,6 +1511,12 @@ NS_ASSUME_NONNULL_BEGIN - (void)readAttributeMaxMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeToleranceWithResponseHandler:(ResponseHandler)responseHandler; +- (void)subscribeAttributeToleranceWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeToleranceWithResponseHandler:(ResponseHandler)responseHandler; + - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -1526,6 +1540,7 @@ NS_ASSUME_NONNULL_BEGIN f:(uint8_t)f responseHandler:(ResponseHandler)responseHandler; - (void)testNotHandled:(ResponseHandler)responseHandler; +- (void)testNullableOptionalRequest:(uint8_t)arg1 responseHandler:(ResponseHandler)responseHandler; - (void)testSpecific:(ResponseHandler)responseHandler; - (void)testStructArgumentRequest:(uint8_t)a b:(bool)b @@ -1663,6 +1678,9 @@ NS_ASSUME_NONNULL_BEGIN - (void)readAttributeMaxCoolSetpointLimitWithResponseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeMaxCoolSetpointLimitWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeMinSetpointDeadBandWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeMinSetpointDeadBandWithValue:(int8_t)value responseHandler:(ResponseHandler)responseHandler; + - (void)readAttributeControlSequenceOfOperationWithResponseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeControlSequenceOfOperationWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; @@ -1975,6 +1993,8 @@ NS_ASSUME_NONNULL_BEGIN responseHandler:(ResponseHandler)responseHandler; - (void)reportAttributeSafetyStatusWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeFeatureMapWithResponseHandler:(ResponseHandler)responseHandler; + - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index d6515e7b8b36e3..77dde1cdd581ca 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -2202,6 +2202,13 @@ new CHIPInt16sAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Can }); } +- (void)readAttributeToleranceWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeTolerance(success, failure); + }); +} + - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4087,6 +4094,32 @@ new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Can }); } +- (void)readAttributeToleranceWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeTolerance(success, failure); + }); +} + +- (void)subscribeAttributeToleranceWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.SubscribeAttributeTolerance(success, failure, minInterval, maxInterval); + }); +} + +- (void)reportAttributeToleranceWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge( + self.callbackQueue, responseHandler, + ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReportAttributeTolerance(success); + }, + true); +} + - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4447,6 +4480,32 @@ new CHIPInt16sAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Can }); } +- (void)readAttributeToleranceWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeTolerance(success, failure); + }); +} + +- (void)subscribeAttributeToleranceWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.SubscribeAttributeTolerance(success, failure, minInterval, maxInterval); + }); +} + +- (void)reportAttributeToleranceWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt16uAttributeCallbackBridge( + self.callbackQueue, responseHandler, + ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReportAttributeTolerance(success); + }, + true); +} + - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -4523,6 +4582,14 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc }); } +- (void)testNullableOptionalRequest:(uint8_t)arg1 responseHandler:(ResponseHandler)responseHandler +{ + new CHIPTestClusterClusterTestNullableOptionalResponseCallbackBridge( + self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.TestNullableOptionalRequest(success, failure, arg1); + }); +} + - (void)testSpecific:(ResponseHandler)responseHandler { new CHIPTestClusterClusterTestSpecificResponseCallbackBridge( @@ -5092,6 +5159,20 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc }); } +- (void)readAttributeMinSetpointDeadBandWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt8sAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeMinSetpointDeadBand(success, failure); + }); +} + +- (void)writeAttributeMinSetpointDeadBandWithValue:(int8_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeMinSetpointDeadBand(success, failure, value); + }); +} + - (void)readAttributeControlSequenceOfOperationWithResponseHandler:(ResponseHandler)responseHandler { new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -6166,6 +6247,13 @@ new CHIPInt16uAttributeCallbackBridge( true); } +- (void)readAttributeFeatureMapWithResponseHandler:(ResponseHandler)responseHandler +{ + new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.ReadAttributeFeatureMap(success, failure); + }); +} + - (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h index 9a8c504d6d2932..13af1ebf4d9fa9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h @@ -326,6 +326,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeMeasuredValueWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeMinMeasuredValueWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeMaxMeasuredValueWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeToleranceWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeClusterRevisionWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; @end @@ -620,6 +621,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeMeasuredValueWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeMinMeasuredValueWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeMaxMeasuredValueWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeToleranceWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeClusterRevisionWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; @end @@ -695,6 +697,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeMeasuredValueWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeMinMeasuredValueWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeMaxMeasuredValueWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeToleranceWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeClusterRevisionWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; @end @@ -863,6 +866,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeInstalledOpenLimitTiltWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeInstalledClosedLimitTiltWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeSafetyStatusWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeFeatureMapWithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler; - (void)writeAttributeClusterRevisionWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index cb0060b11121fa..e610ed9d9f6a2c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -1175,6 +1175,13 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc }); } +- (void)writeAttributeToleranceWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeTolerance(success, failure, value); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2133,6 +2140,13 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc }); } +- (void)writeAttributeToleranceWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeTolerance(success, failure, value); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -2358,6 +2372,13 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc }); } +- (void)writeAttributeToleranceWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeTolerance(success, failure, value); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { @@ -3184,6 +3205,13 @@ new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Canc }); } +- (void)writeAttributeFeatureMapWithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler +{ + new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { + return self.cppCluster.WriteAttributeFeatureMap(success, failure, value); + }); +} + - (void)writeAttributeClusterRevisionWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { new CHIPDefaultSuccessCallbackBridge(self.callbackQueue, responseHandler, ^(Cancelable * success, Cancelable * failure) { diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 5d0a2a2f3299f8..a301259bf075ad 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -7282,6 +7282,204 @@ - (void)testSendClusterTest_TC_OCC_1_1_000001_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_OCC_2_1_000000_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads mandatory attribute constrains: Occupancy"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOccupancyWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Reads mandatory attribute constrains: Occupancy Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertLessThanOrEqual([values[@"value"] unsignedCharValue], 1); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_OCC_2_1_000001_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Writes the respective default value to mandatory attribute: Occupancy"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t occupancyArgument = 0; + [cluster writeAttributeOccupancyWithValue:occupancyArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Writes the respective default value to mandatory attribute: Occupancy Error: %@", err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_OCC_2_1_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: Occupancy"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOccupancyWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Reads back mandatory attribute: Occupancy Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_OCC_2_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Reads mandatory attribute constrains: OccupancySensorType"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOccupancySensorTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Reads mandatory attribute constrains: OccupancySensorType Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertLessThanOrEqual([values[@"value"] unsignedCharValue], 3); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_OCC_2_1_000004_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Writes the respective default value to mandatory attribute: OccupancySensorType"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t occupancySensorTypeArgument = 0; + [cluster writeAttributeOccupancySensorTypeWithValue:occupancySensorTypeArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Writes the respective default value to mandatory attribute: " + @"OccupancySensorType Error: %@", + err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_OCC_2_1_000005_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads back mandatory attribute: OccupancySensorType"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOccupancySensorTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Reads back mandatory attribute: OccupancySensorType Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_OCC_2_1_000006_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Reads mandatory attribute constrains: OccupancySensorTypeBitmap"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOccupancySensorTypeBitmapWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Reads mandatory attribute constrains: OccupancySensorTypeBitmap Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertGreaterThanOrEqual([values[@"value"] unsignedCharValue], 1); + XCTAssertLessThanOrEqual([values[@"value"] unsignedCharValue], 7); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_OCC_2_1_000007_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Writes the respective default value to mandatory attribute: OccupancySensorTypeBitmap"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t occupancySensorTypeBitmapArgument = 1; + [cluster writeAttributeOccupancySensorTypeBitmapWithValue:occupancySensorTypeBitmapArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Writes the respective default value to mandatory attribute: " + @"OccupancySensorTypeBitmap Error: %@", + err); + + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_OCC_2_1_000008_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Reads back mandatory attribute: OccupancySensorTypeBitmap"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestOccupancySensing * cluster = [[CHIPTestOccupancySensing alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOccupancySensorTypeBitmapWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Reads back mandatory attribute: OccupancySensorTypeBitmap Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 1); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_OO_1_1_000000_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; @@ -8140,6 +8338,126 @@ - (void)testSendClusterTest_TC_PCC_2_1_000007_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_PCC_2_2_000000_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write 1 to the OperationMode attribute to DUT: OperationMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t operationModeArgument = 1; + [cluster writeAttributeOperationModeWithValue:operationModeArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write 1 to the OperationMode attribute to DUT: OperationMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_2_000001_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write 2 to the OperationMode attribute to DUT: OperationMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t operationModeArgument = 2; + [cluster writeAttributeOperationModeWithValue:operationModeArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write 2 to the OperationMode attribute to DUT: OperationMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_2_000002_WriteAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"Write 3 to the OperationMode attribute to DUT: OperationMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t operationModeArgument = 3; + [cluster writeAttributeOperationModeWithValue:operationModeArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write 3 to the OperationMode attribute to DUT: OperationMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTest_TC_PCC_2_3_000000_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write 0 to the OperationMode attribute to DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t operationModeArgument = 0; + [cluster writeAttributeOperationModeWithValue:operationModeArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Write 0 to the OperationMode attribute to DUT Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_PCC_2_3_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads the attribute: EffectiveOperationMode"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEffectiveOperationModeWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Reads the attribute: EffectiveOperationMode Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedCharValue], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_RH_1_1_000000_WriteAttribute { XCTestExpectation * expectation = @@ -8165,6 +8483,51 @@ - (void)testSendClusterTest_TC_RH_1_1_000000_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_RH_2_1_000000_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads constraints of attribute: MeasuredValue"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Reads constraints of attribute: MeasuredValue Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_RH_2_1_000001_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Reads constraints of attribute: MinMeasuredValue"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestRelativeHumidityMeasurement * cluster = [[CHIPTestRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMinMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Reads constraints of attribute: MinMeasuredValue Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertLessThanOrEqual([values[@"value"] unsignedShortValue], 9999); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_TM_1_1_000000_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: ClusterRevision"]; @@ -8766,6 +9129,48 @@ - (void)testSendClusterTest_TC_WNCV_1_1_000002_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTest_TC_WNCV_1_1_000003_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"read the global attribute: FeatureMap"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeFeatureMapWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"read the global attribute: FeatureMap Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_WNCV_1_1_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"reads back global attribute: FeatureMap"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeFeatureMapWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"reads back global attribute: FeatureMap Error: %@", err); + + XCTAssertEqual(err.code, 0); + + XCTAssertEqual([values[@"value"] unsignedLongValue], 0UL); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTest_TC_WNCV_2_1_000000_ReadAttribute { @@ -12154,6 +12559,28 @@ - (void)testSendClusterTestBasicInformation_000003_WriteAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTestIdentifyCluster_000000_Identify +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Send Identify command and expect success response"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestIdentify * cluster = [[CHIPTestIdentify alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t identifyTimeArgument = 0U; + [cluster identify:identifyTimeArgument + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Send Identify command and expect success response Error: %@", err); + + XCTAssertEqual(err.code, 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTestOperationalCredentialsCluster_000000_ReadAttribute { XCTestExpectation * expectation = [self expectationWithDescription:@"Read number of supported fabrics"]; @@ -15218,6 +15645,24 @@ - (void)testSendClusterFlowMeasurementReadAttributeMaxMeasuredValueWithResponseH [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterFlowMeasurementReadAttributeToleranceWithResponseHandler +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"FlowMeasurementReadAttributeToleranceWithResponseHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPFlowMeasurement * cluster = [[CHIPFlowMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeToleranceWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"FlowMeasurement Tolerance Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterFlowMeasurementReadAttributeClusterRevisionWithResponseHandler { XCTestExpectation * expectation = @@ -17842,6 +18287,27 @@ - (void)testSendClusterRelativeHumidityMeasurementReadAttributeMaxMeasuredValueW [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterRelativeHumidityMeasurementReadAttributeToleranceWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"RelativeHumidityMeasurementReadAttributeToleranceWithResponseHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPRelativeHumidityMeasurement * cluster = [[CHIPRelativeHumidityMeasurement alloc] initWithDevice:device + endpoint:1 + queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeToleranceWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"RelativeHumidityMeasurement Tolerance Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterRelativeHumidityMeasurementReadAttributeClusterRevisionWithResponseHandler { XCTestExpectation * expectation = @@ -18269,6 +18735,25 @@ - (void)testSendClusterTemperatureMeasurementReadAttributeMaxMeasuredValueWithRe [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTemperatureMeasurementReadAttributeToleranceWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"TemperatureMeasurementReadAttributeToleranceWithResponseHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeToleranceWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TemperatureMeasurement Tolerance Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTemperatureMeasurementReadAttributeClusterRevisionWithResponseHandler { XCTestExpectation * expectation = @@ -18611,6 +19096,44 @@ - (void)testSendClusterThermostatWriteAttributeMaxCoolSetpointLimitWithValue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterThermostatReadAttributeMinSetpointDeadBandWithResponseHandler +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"ThermostatReadAttributeMinSetpointDeadBandWithResponseHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeMinSetpointDeadBandWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Thermostat MinSetpointDeadBand Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterThermostatWriteAttributeMinSetpointDeadBandWithValue +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatWriteAttributeMinSetpointDeadBandWithValue"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + int8_t value = 0x0A; + [cluster writeAttributeMinSetpointDeadBandWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Thermostat MinSetpointDeadBand Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterThermostatReadAttributeControlSequenceOfOperationWithResponseHandler { XCTestExpectation * expectation = @@ -20811,6 +21334,24 @@ - (void)testSendClusterWindowCoveringReadAttributeSafetyStatusWithResponseHandle [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterWindowCoveringReadAttributeFeatureMapWithResponseHandler +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"WindowCoveringReadAttributeFeatureMapWithResponseHandler"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPWindowCovering * cluster = [[CHIPWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeFeatureMapWithResponseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"WindowCovering FeatureMap Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterWindowCoveringReadAttributeClusterRevisionWithResponseHandler { XCTestExpectation * expectation = diff --git a/src/include/platform/ConfigurationManager.h b/src/include/platform/ConfigurationManager.h index 632ed1540b0aaf..f0c0758b8f1877 100644 --- a/src/include/platform/ConfigurationManager.h +++ b/src/include/platform/ConfigurationManager.h @@ -80,7 +80,7 @@ class ConfigurationManager virtual CHIP_ERROR GetPrimary802154MACAddress(uint8_t * buf) = 0; virtual CHIP_ERROR GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & dayOfMonth) = 0; virtual CHIP_ERROR GetFirmwareRevisionString(char * buf, size_t bufSize) = 0; - virtual CHIP_ERROR GetFirmwareRevision(uint32_t & firmwareRev) = 0; + virtual CHIP_ERROR GetFirmwareRevision(uint16_t & firmwareRev) = 0; virtual CHIP_ERROR GetSetupPinCode(uint32_t & setupPinCode) = 0; virtual CHIP_ERROR GetSetupDiscriminator(uint16_t & setupDiscriminator) = 0; #if CHIP_ENABLE_ROTATING_DEVICE_ID diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h index 430a8f84baa390..11b07128ce04ec 100644 --- a/src/include/platform/ConnectivityManager.h +++ b/src/include/platform/ConnectivityManager.h @@ -55,7 +55,7 @@ constexpr size_t kMaxHardwareAddrSize = 8; struct NetworkInterface : public app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::Type { - char Name[Inet::InterfaceIterator::kMaxIfNameLength]; + char Name[Inet::InterfaceId::kMaxIfNameLength]; uint8_t MacAddress[kMaxHardwareAddrSize]; NetworkInterface * Next; /* Pointer to the next structure. */ }; diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.h b/src/include/platform/internal/GenericConfigurationManagerImpl.h index 1ca986a52ddf00..e2dbcdb3173fbc 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.h +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.h @@ -62,7 +62,7 @@ class GenericConfigurationManagerImpl : public ConfigurationManager CHIP_ERROR GetProductRevision(uint16_t & productRev) override; CHIP_ERROR StoreProductRevision(uint16_t productRev) override; CHIP_ERROR GetFirmwareRevisionString(char * buf, size_t bufSize) override; - CHIP_ERROR GetFirmwareRevision(uint32_t & firmwareRev) override; + CHIP_ERROR GetFirmwareRevision(uint16_t & firmwareRev) override; CHIP_ERROR GetSerialNumber(char * buf, size_t bufSize, size_t & serialNumLen) override; CHIP_ERROR StoreSerialNumber(const char * serialNum, size_t serialNumLen) override; CHIP_ERROR GetPrimaryMACAddress(MutableByteSpan buf) override; @@ -134,7 +134,7 @@ inline CHIP_ERROR GenericConfigurationManagerImpl::GetProductId(uint1 } template -inline CHIP_ERROR GenericConfigurationManagerImpl::GetFirmwareRevision(uint32_t & firmwareRev) +inline CHIP_ERROR GenericConfigurationManagerImpl::GetFirmwareRevision(uint16_t & firmwareRev) { firmwareRev = static_cast(CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION); return CHIP_NO_ERROR; diff --git a/src/inet/IPEndPointBasis.cpp b/src/inet/IPEndPointBasis.cpp index f88841a0b4d1b1..8ea3c07b3acf98 100644 --- a/src/inet/IPEndPointBasis.cpp +++ b/src/inet/IPEndPointBasis.cpp @@ -118,12 +118,11 @@ namespace chip { namespace Inet { #if CHIP_SYSTEM_CONFIG_USE_LWIP || CHIP_SYSTEM_CONFIG_USE_SOCKETS + static CHIP_ERROR CheckMulticastGroupArgs(InterfaceId aInterfaceId, const IPAddress & aAddress) { - VerifyOrReturnError(IsInterfaceIdPresent(aInterfaceId), INET_ERROR_UNKNOWN_INTERFACE); - + VerifyOrReturnError(aInterfaceId.IsPresent(), INET_ERROR_UNKNOWN_INTERFACE); VerifyOrReturnError(aAddress.IsMulticast(), INET_ERROR_WRONG_ADDRESS_TYPE); - return CHIP_NO_ERROR; } #endif // CHIP_SYSTEM_CONFIG_USE_LWIP || CHIP_SYSTEM_CONFIG_USE_SOCKETS @@ -244,11 +243,11 @@ struct netif * IPEndPointBasis::FindNetifFromInterfaceId(InterfaceId aInterfaceI #if LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 0 && defined(NETIF_FOREACH) NETIF_FOREACH(lRetval) { - if (lRetval == aInterfaceId) + if (lRetval == aInterfaceId.GetPlatformInterface()) break; } #else // LWIP_VERSION_MAJOR < 2 || !defined(NETIF_FOREACH) - for (lRetval = netif_list; lRetval != NULL && lRetval != aInterfaceId; lRetval = lRetval->next) + for (lRetval = netif_list; lRetval != NULL && lRetval != aInterfaceId.GetPlatformInterface(); lRetval = lRetval->next) ; #endif // LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 0 && defined(NETIF_FOREACH) @@ -359,7 +358,7 @@ CHIP_ERROR IPEndPointBasis::SetMulticastLoopback(IPVersion aIPVersion, bool aLoo void IPEndPointBasis::InitImpl() { - mBoundIntfId = INET_NULL_INTERFACEID; + mBoundIntfId = InterfaceId::Null(); } #if INET_CONFIG_ENABLE_IPV4 @@ -374,7 +373,7 @@ static CHIP_ERROR SocketsIPv4JoinLeaveMulticastGroup(int aSocket, InterfaceId aI { const IPAddress lCurrentAddress = lAddressIterator.GetAddress(); - if (lAddressIterator.GetInterface() == aInterfaceId) + if (lAddressIterator.GetInterfaceId() == aInterfaceId) { if (lCurrentAddress.IsIPv4()) { @@ -410,8 +409,7 @@ CHIP_ERROR IPEndPointBasis::IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInterfa static CHIP_ERROR SocketsIPv6JoinLeaveMulticastGroup(int aSocket, InterfaceId aInterfaceId, const IPAddress & aAddress, int aCommand) { - VerifyOrReturnError(CanCastTo(aInterfaceId), CHIP_ERROR_UNEXPECTED_EVENT); - const unsigned int lIfIndex = static_cast(aInterfaceId); + const InterfaceId::PlatformType lIfIndex = aInterfaceId.GetPlatformInterface(); struct ipv6_mreq lMulticastRequest; memset(&lMulticastRequest, 0, sizeof(lMulticastRequest)); @@ -455,14 +453,15 @@ CHIP_ERROR IPEndPointBasis::Bind(IPAddressType aAddressType, const IPAddress & a memset(&sa, 0, sizeof(sa)); - sa.sin6_family = AF_INET6; - sa.sin6_port = htons(aPort); - sa.sin6_addr = aAddress.ToIPv6(); - if (!CanCastTo(aInterfaceId)) + sa.sin6_family = AF_INET6; + sa.sin6_port = htons(aPort); + sa.sin6_addr = aAddress.ToIPv6(); + InterfaceId::PlatformType interfaceId = aInterfaceId.GetPlatformInterface(); + if (!CanCastTo(interfaceId)) { return CHIP_ERROR_INCORRECT_STATE; } - sa.sin6_scope_id = static_cast(aInterfaceId); + sa.sin6_scope_id = static_cast(interfaceId); if (bind(mSocket, reinterpret_cast(&sa), static_cast(sizeof(sa))) != 0) lRetval = CHIP_ERROR_POSIX(errno); @@ -526,7 +525,7 @@ CHIP_ERROR IPEndPointBasis::BindInterface(IPAddressType aAddressType, InterfaceI CHIP_ERROR lRetval = CHIP_NO_ERROR; #if HAVE_SO_BINDTODEVICE - if (aInterfaceId == INET_NULL_INTERFACEID) + if (!aInterfaceId.IsPresent()) { // Stop interface-based filtering. if (setsockopt(mSocket, SOL_SOCKET, SO_BINDTODEVICE, "", 0) == -1) @@ -539,7 +538,7 @@ CHIP_ERROR IPEndPointBasis::BindInterface(IPAddressType aAddressType, InterfaceI // Start filtering on the passed interface. char lInterfaceName[IF_NAMESIZE]; - if (if_indextoname(aInterfaceId, lInterfaceName) == NULL) + if (if_indextoname(aInterfaceId.GetPlatformInterface(), lInterfaceName) == NULL) { lRetval = CHIP_ERROR_POSIX(errno); } @@ -589,11 +588,12 @@ CHIP_ERROR IPEndPointBasis::SendMsg(const IPPacketInfo * aPktInfo, chip::System: msgHeader.msg_name = &peerSockAddr; if (mAddrType == IPAddressType::kIPv6) { - peerSockAddr.in6.sin6_family = AF_INET6; - peerSockAddr.in6.sin6_port = htons(aPktInfo->DestPort); - peerSockAddr.in6.sin6_addr = aPktInfo->DestAddress.ToIPv6(); - VerifyOrReturnError(CanCastTo(aPktInfo->Interface), CHIP_ERROR_INCORRECT_STATE); - peerSockAddr.in6.sin6_scope_id = static_cast(aPktInfo->Interface); + peerSockAddr.in6.sin6_family = AF_INET6; + peerSockAddr.in6.sin6_port = htons(aPktInfo->DestPort); + peerSockAddr.in6.sin6_addr = aPktInfo->DestAddress.ToIPv6(); + InterfaceId::PlatformType intfId = aPktInfo->Interface.GetPlatformInterface(); + VerifyOrReturnError(CanCastTo(intfId), CHIP_ERROR_INCORRECT_STATE); + peerSockAddr.in6.sin6_scope_id = static_cast(intfId); msgHeader.msg_namelen = sizeof(sockaddr_in6); } #if INET_CONFIG_ENABLE_IPV4 @@ -612,21 +612,22 @@ CHIP_ERROR IPEndPointBasis::SendMsg(const IPPacketInfo * aPktInfo, chip::System: // for messages to multicast addresses, which under Linux // don't seem to get sent out the correct interface, despite // the socket being bound. - InterfaceId intfId = aPktInfo->Interface; - if (intfId == INET_NULL_INTERFACEID) - intfId = mBoundIntfId; + InterfaceId intf = aPktInfo->Interface; + if (!intf.IsPresent()) + intf = mBoundIntfId; // If the packet should be sent over a specific interface, or with a specific source // address, construct an IP_PKTINFO/IPV6_PKTINFO "control message" to that effect // add add it to the message header. If the local OS doesn't support IP_PKTINFO/IPV6_PKTINFO // fail with an error. - if (intfId != INET_NULL_INTERFACEID || aPktInfo->SrcAddress.Type() != IPAddressType::kAny) + if (intf.IsPresent() || aPktInfo->SrcAddress.Type() != IPAddressType::kAny) { #if defined(IP_PKTINFO) || defined(IPV6_PKTINFO) msgHeader.msg_control = controlData; msgHeader.msg_controllen = sizeof(controlData); - struct cmsghdr * controlHdr = CMSG_FIRSTHDR(&msgHeader); + struct cmsghdr * controlHdr = CMSG_FIRSTHDR(&msgHeader); + InterfaceId::PlatformType intfId = intf.GetPlatformInterface(); #if INET_CONFIG_ENABLE_IPV4 @@ -874,12 +875,12 @@ void IPEndPointBasis::HandlePendingIO(uint16_t aPort) if (controlHdr->cmsg_level == IPPROTO_IP && controlHdr->cmsg_type == IP_PKTINFO) { struct in_pktinfo * inPktInfo = reinterpret_cast CMSG_DATA(controlHdr); - if (!CanCastTo(inPktInfo->ipi_ifindex)) + if (!CanCastTo(inPktInfo->ipi_ifindex)) { lStatus = CHIP_ERROR_INCORRECT_STATE; break; } - lPacketInfo.Interface = static_cast(inPktInfo->ipi_ifindex); + lPacketInfo.Interface = InterfaceId(static_cast(inPktInfo->ipi_ifindex)); lPacketInfo.DestAddress = IPAddress(inPktInfo->ipi_addr); continue; } @@ -890,12 +891,12 @@ void IPEndPointBasis::HandlePendingIO(uint16_t aPort) if (controlHdr->cmsg_level == IPPROTO_IPV6 && controlHdr->cmsg_type == IPV6_PKTINFO) { struct in6_pktinfo * in6PktInfo = reinterpret_cast CMSG_DATA(controlHdr); - if (!CanCastTo(in6PktInfo->ipi6_ifindex)) + if (!CanCastTo(in6PktInfo->ipi6_ifindex)) { lStatus = CHIP_ERROR_INCORRECT_STATE; break; } - lPacketInfo.Interface = static_cast(in6PktInfo->ipi6_ifindex); + lPacketInfo.Interface = InterfaceId(static_cast(in6PktInfo->ipi6_ifindex)); lPacketInfo.DestAddress = IPAddress(in6PktInfo->ipi6_addr); continue; } diff --git a/src/inet/InetInterface.cpp b/src/inet/InetInterface.cpp index 204baa4bd2a408..0cff70e50b425d 100644 --- a/src/inet/InetInterface.cpp +++ b/src/inet/InetInterface.cpp @@ -71,31 +71,36 @@ namespace Inet { #if CHIP_SYSTEM_CONFIG_USE_LWIP -DLL_EXPORT CHIP_ERROR GetInterfaceName(InterfaceId intfId, char * nameBuf, size_t nameBufSize) +CHIP_ERROR InterfaceId::GetInterfaceName(char * nameBuf, size_t nameBufSize) const { - if (intfId != INET_NULL_INTERFACEID) + if (mPlatformInterface) { - int status = snprintf(nameBuf, nameBufSize, "%c%c%d", intfId->name[0], intfId->name[1], intfId->num); + int status = snprintf(nameBuf, nameBufSize, "%c%c%d", mPlatformInterface->name[0], mPlatformInterface->name[1], + mPlatformInterface->num); if (status >= static_cast(nameBufSize)) - return CHIP_ERROR_NO_MEMORY; + return CHIP_ERROR_BUFFER_TOO_SMALL; return CHIP_NO_ERROR; } - if (nameBufSize < 1) - return CHIP_ERROR_NO_MEMORY; - + { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } nameBuf[0] = 0; return CHIP_NO_ERROR; } -DLL_EXPORT CHIP_ERROR InterfaceNameToId(const char * intfName, InterfaceId & intfId) +CHIP_ERROR InterfaceId::InterfaceNameToId(const char * intfName, InterfaceId & interface) { if (strlen(intfName) < 3) + { return INET_ERROR_UNKNOWN_INTERFACE; + } char * parseEnd; unsigned long intfNum = strtoul(intfName + 2, &parseEnd, 10); if (*parseEnd != 0 || intfNum > UINT8_MAX) + { return INET_ERROR_UNKNOWN_INTERFACE; + } struct netif * intf; #if LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 0 && defined(NETIF_FOREACH) NETIF_FOREACH(intf) @@ -105,17 +110,16 @@ DLL_EXPORT CHIP_ERROR InterfaceNameToId(const char * intfName, InterfaceId & int { if (intf->name[0] == intfName[0] && intf->name[1] == intfName[1] && intf->num == (uint8_t) intfNum) { - intfId = intf; + interface = InterfaceId(intf); return CHIP_NO_ERROR; } } - intfId = INET_NULL_INTERFACEID; + interface = InterfaceId::Null(); return INET_ERROR_UNKNOWN_INTERFACE; } bool InterfaceIterator::Next() { - // Lock LwIP stack LOCK_TCPIP_CORE(); @@ -144,7 +148,7 @@ bool InterfaceIterator::Next() CHIP_ERROR InterfaceIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize) { VerifyOrReturnError(HasCurrent(), CHIP_ERROR_INCORRECT_STATE); - return ::chip::Inet::GetInterfaceName(mCurNetif, nameBuf, nameBufSize); + return InterfaceId(mCurNetif).GetInterfaceName(nameBuf, nameBufSize); } bool InterfaceIterator::IsUp() @@ -178,7 +182,7 @@ bool InterfaceAddressIterator::Next() while (mIntfIter.HasCurrent()) { - struct netif * curIntf = mIntfIter.GetInterfaceId(); + struct netif * curIntf = mIntfIter.GetInterfaceId().GetPlatformInterface(); while (mCurAddrIndex < LWIP_IPV6_NUM_ADDRESSES) { @@ -210,7 +214,7 @@ IPAddress InterfaceAddressIterator::GetAddress() { if (HasCurrent()) { - struct netif * curIntf = mIntfIter.GetInterfaceId(); + struct netif * curIntf = mIntfIter.GetInterfaceId().GetPlatformInterface(); if (mCurAddrIndex < LWIP_IPV6_NUM_ADDRESSES) { @@ -238,7 +242,7 @@ uint8_t InterfaceAddressIterator::GetPrefixLength() #if INET_CONFIG_ENABLE_IPV4 && LWIP_IPV4 else { - struct netif * curIntf = mIntfIter.GetInterfaceId(); + struct netif * curIntf = mIntfIter.GetInterfaceId().GetPlatformInterface(); return NetmaskToPrefixLength((const uint8_t *) netif_ip4_netmask(curIntf), 4); } #endif // INET_CONFIG_ENABLE_IPV4 && LWIP_IPV4 @@ -248,11 +252,7 @@ uint8_t InterfaceAddressIterator::GetPrefixLength() InterfaceId InterfaceAddressIterator::GetInterfaceId() { - if (HasCurrent()) - { - return mIntfIter.GetInterfaceId(); - } - return INET_NULL_INTERFACEID; + return HasCurrent() ? mIntfIter.GetInterfaceId() : InterfaceId::Null(); } CHIP_ERROR InterfaceAddressIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize) @@ -263,60 +263,56 @@ CHIP_ERROR InterfaceAddressIterator::GetInterfaceName(char * nameBuf, size_t nam bool InterfaceAddressIterator::IsUp() { - if (HasCurrent()) - { - return mIntfIter.IsUp(); - } - return false; + return HasCurrent() && mIntfIter.IsUp(); } bool InterfaceAddressIterator::SupportsMulticast() { - if (HasCurrent()) - { - return mIntfIter.SupportsMulticast(); - } - return false; + return HasCurrent() && mIntfIter.SupportsMulticast(); } bool InterfaceAddressIterator::HasBroadcastAddress() { - if (HasCurrent()) - { - return mIntfIter.HasBroadcastAddress(); - } - return false; + return HasCurrent() && mIntfIter.HasBroadcastAddress(); } #endif // CHIP_SYSTEM_CONFIG_USE_LWIP #if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS -DLL_EXPORT CHIP_ERROR GetInterfaceName(InterfaceId intfId, char * nameBuf, size_t nameBufSize) +CHIP_ERROR InterfaceId::GetInterfaceName(char * nameBuf, size_t nameBufSize) const { - if (intfId != INET_NULL_INTERFACEID) + if (mPlatformInterface) { char intfName[IF_NAMESIZE]; - if (if_indextoname(intfId, intfName) == nullptr) + if (if_indextoname(mPlatformInterface, intfName) == nullptr) + { return CHIP_ERROR_POSIX(errno); - if (strlen(intfName) >= nameBufSize) - return CHIP_ERROR_NO_MEMORY; - strcpy(nameBuf, intfName); + } + size_t nameLength = strlen(intfName); + if (nameLength >= nameBufSize) + { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + strncpy(nameBuf, intfName, nameLength + 1); return CHIP_NO_ERROR; } - if (nameBufSize < 1) - return CHIP_ERROR_NO_MEMORY; - + { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } nameBuf[0] = 0; return CHIP_NO_ERROR; } -DLL_EXPORT CHIP_ERROR InterfaceNameToId(const char * intfName, InterfaceId & intfId) +CHIP_ERROR InterfaceId::InterfaceNameToId(const char * intfName, InterfaceId & interface) { - intfId = if_nametoindex(intfName); + unsigned int intfId = if_nametoindex(intfName); + interface = InterfaceId(intfId); if (intfId == 0) + { return (errno == ENXIO) ? INET_ERROR_UNKNOWN_INTERFACE : CHIP_ERROR_POSIX(errno); + } return CHIP_NO_ERROR; } @@ -532,7 +528,6 @@ bool InterfaceIterator::HasCurrent() bool InterfaceIterator::Next() { - if (mIntfArray == nullptr) { #if __ANDROID__ && __ANDROID_API__ < 24 @@ -552,13 +547,13 @@ bool InterfaceIterator::Next() InterfaceId InterfaceIterator::GetInterfaceId() { - return (HasCurrent()) ? mIntfArray[mCurIntf].if_index : INET_NULL_INTERFACEID; + return HasCurrent() ? InterfaceId(mIntfArray[mCurIntf].if_index) : InterfaceId::Null(); } CHIP_ERROR InterfaceIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize) { VerifyOrReturnError(HasCurrent(), CHIP_ERROR_INCORRECT_STATE); - VerifyOrReturnError(strlen(mIntfArray[mCurIntf].if_name) < nameBufSize, CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(strlen(mIntfArray[mCurIntf].if_name) < nameBufSize, CHIP_ERROR_BUFFER_TOO_SMALL); strncpy(nameBuf, mIntfArray[mCurIntf].if_name, nameBufSize); return CHIP_NO_ERROR; } @@ -593,7 +588,6 @@ short InterfaceIterator::GetFlags() mIntfFlags = intfData.ifr_flags; mIntfFlagsCached = true; } - CloseIOCTLSocket(); } return mIntfFlags; @@ -656,12 +650,7 @@ bool InterfaceAddressIterator::Next() IPAddress InterfaceAddressIterator::GetAddress() { - if (HasCurrent()) - { - return IPAddress::FromSockAddr(*mCurAddr->ifa_addr); - } - - return IPAddress::Any; + return HasCurrent() ? IPAddress::FromSockAddr(*mCurAddr->ifa_addr) : IPAddress::Any; } uint8_t InterfaceAddressIterator::GetPrefixLength() @@ -690,73 +679,63 @@ uint8_t InterfaceAddressIterator::GetPrefixLength() InterfaceId InterfaceAddressIterator::GetInterfaceId() { - if (HasCurrent()) - { - return if_nametoindex(mCurAddr->ifa_name); - } - return INET_NULL_INTERFACEID; + return HasCurrent() ? InterfaceId(if_nametoindex(mCurAddr->ifa_name)) : InterfaceId::Null(); } CHIP_ERROR InterfaceAddressIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize) { VerifyOrReturnError(HasCurrent(), CHIP_ERROR_INCORRECT_STATE); - VerifyOrReturnError(strlen(mCurAddr->ifa_name) < nameBufSize, CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(strlen(mCurAddr->ifa_name) < nameBufSize, CHIP_ERROR_BUFFER_TOO_SMALL); strncpy(nameBuf, mCurAddr->ifa_name, nameBufSize); return CHIP_NO_ERROR; } bool InterfaceAddressIterator::IsUp() { - if (HasCurrent()) - { - return (mCurAddr->ifa_flags & IFF_UP) != 0; - } - return false; + return HasCurrent() && (mCurAddr->ifa_flags & IFF_UP) != 0; } bool InterfaceAddressIterator::SupportsMulticast() { - if (HasCurrent()) - { - return (mCurAddr->ifa_flags & IFF_MULTICAST) != 0; - } - return false; + return HasCurrent() && (mCurAddr->ifa_flags & IFF_MULTICAST) != 0; } bool InterfaceAddressIterator::HasBroadcastAddress() { - if (HasCurrent()) - { - return (mCurAddr->ifa_flags & IFF_BROADCAST) != 0; - } - return false; + return HasCurrent() && (mCurAddr->ifa_flags & IFF_BROADCAST) != 0; } #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS #if CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF -DLL_EXPORT CHIP_ERROR GetInterfaceName(InterfaceId intfId, char * nameBuf, size_t nameBufSize) +CHIP_ERROR InterfaceId::GetInterfaceName(char * nameBuf, size_t nameBufSize) const { - if (intfId != INET_NULL_INTERFACEID) + if (mPlatformInterface) { - net_if * currentInterface = net_if_get_by_index(intfId); + net_if * currentInterface = net_if_get_by_index(mPlatformInterface); if (!currentInterface) + { return CHIP_ERROR_INCORRECT_STATE; + } const char * name = net_if_get_device(currentInterface)->name; - if (strlen(name) >= nameBufSize) - return CHIP_ERROR_NO_MEMORY; - strcpy(nameBuf, name); + size_t nameLength = strlen(name); + if (nameLength >= nameBufSize) + { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + strncpy(nameBuf, name, nameLength + 1); return CHIP_NO_ERROR; } - if (nameBufSize < 1) - return CHIP_ERROR_NO_MEMORY; - + { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } nameBuf[0] = 0; return CHIP_NO_ERROR; } -DLL_EXPORT CHIP_ERROR InterfaceNameToId(const char * intfName, InterfaceId & intfId) + +CHIP_ERROR InterfaceId::InterfaceNameToId(const char * intfName, InterfaceId & interface) { int currentId = 0; net_if * currentInterface; @@ -765,10 +744,11 @@ DLL_EXPORT CHIP_ERROR InterfaceNameToId(const char * intfName, InterfaceId & int { if (strcmp(net_if_get_device(currentInterface)->name, intfName) == 0) { - intfId = currentId; + interface = InterfaceId(currentId); return CHIP_NO_ERROR; } } + interface = InterfaceId::Null(); return INET_ERROR_UNKNOWN_INTERFACE; } @@ -787,13 +767,13 @@ bool InterfaceIterator::Next() InterfaceId InterfaceIterator::GetInterfaceId(void) { - return HasCurrent() ? mCurrentId : INET_NULL_INTERFACEID; + return HasCurrent() ? InterfaceId(mCurrentId) : InterfaceId::Null(); } CHIP_ERROR InterfaceIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize) { VerifyOrReturnError(HasCurrent(), CHIP_ERROR_INCORRECT_STATE); - return ::chip::Inet::GetInterfaceName(mCurrentId, nameBuf, nameBufSize); + return InterfaceId(mCurrentId).GetInterfaceName(nameBuf, nameBufSize); } bool InterfaceIterator::IsUp() @@ -825,8 +805,9 @@ bool InterfaceAddressIterator::Next() { if (mCurAddrIndex == -1) // first address for the current interface { - const net_if_config * config = net_if_get_config(net_if_get_by_index(mIntfIter.GetInterfaceId())); - mIpv6 = config->ip.ipv6; + const net_if_config * config = + net_if_get_config(net_if_get_by_index(mIntfIter.GetInterfaceId().GetPlatformInterface())); + mIpv6 = config->ip.ipv6; } while (++mCurAddrIndex < NET_IF_MAX_IPV6_ADDR) @@ -842,19 +823,14 @@ bool InterfaceAddressIterator::Next() IPAddress InterfaceAddressIterator::GetAddress() { - if (HasCurrent()) - { - return IPAddress(mIpv6->unicast[mCurAddrIndex].address.in6_addr); - } - - return IPAddress::Any; + return HasCurrent() ? IPAddress(mIpv6->unicast[mCurAddrIndex].address.in6_addr) : IPAddress::Any; } uint8_t InterfaceAddressIterator::GetPrefixLength() { if (HasCurrent()) { - net_if * const iface = net_if_get_by_index(mIntfIter.GetInterfaceId()); + net_if * const iface = net_if_get_by_index(mIntfIter.GetInterfaceId().GetPlatformInterface()); net_if_ipv6_prefix * const prefix = net_if_ipv6_prefix_get(iface, &mIpv6->unicast[mCurAddrIndex].address.in6_addr); return prefix ? prefix->len : 128; } @@ -863,11 +839,7 @@ uint8_t InterfaceAddressIterator::GetPrefixLength() InterfaceId InterfaceAddressIterator::GetInterfaceId() { - if (HasCurrent()) - { - return mIntfIter.GetInterfaceId(); - } - return INET_NULL_INTERFACEID; + return HasCurrent() ? mIntfIter.GetInterfaceId() : InterfaceId::Null(); } CHIP_ERROR InterfaceAddressIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize) @@ -878,29 +850,17 @@ CHIP_ERROR InterfaceAddressIterator::GetInterfaceName(char * nameBuf, size_t nam bool InterfaceAddressIterator::IsUp() { - if (HasCurrent()) - { - return mIntfIter.IsUp(); - } - return false; + return HasCurrent() && mIntfIter.IsUp(); } bool InterfaceAddressIterator::SupportsMulticast() { - if (HasCurrent()) - { - return mIntfIter.SupportsMulticast(); - } - return false; + return HasCurrent() && mIntfIter.SupportsMulticast(); } bool InterfaceAddressIterator::HasBroadcastAddress() { - if (HasCurrent()) - { - return mIntfIter.HasBroadcastAddress(); - } - return false; + return HasCurrent() && mIntfIter.HasBroadcastAddress(); } #endif // CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF diff --git a/src/inet/InetInterface.h b/src/inet/InetInterface.h index c5e512f95767d0..1de4b17ef63be3 100644 --- a/src/inet/InetInterface.h +++ b/src/inet/InetInterface.h @@ -59,91 +59,98 @@ class IPAddress; class IPPrefix; /** - * @typedef InterfaceId - * - * @brief Indicator for system network interfaces. - * - * @details - * Portability depends on never witnessing this alias. It may be replaced by a - * concrete opaque class in the future. - * - * Note Well: The term "interface identifier" also conventionally refers to - * the lower 64 bits of an IPv6 address in all the relevant IETF standards - * documents, where the abbreviation "IID" is often used. In this text, the - * term "interface indicator" refers to values of this type alias. + * Indicator for system network interfaces. */ - +class InterfaceId +{ +public: #if CHIP_SYSTEM_CONFIG_USE_LWIP -typedef struct netif * InterfaceId; -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP + using PlatformType = struct netif *; + static constexpr size_t kMaxIfNameLength = 13; // Names are formatted as %c%c%d +#endif // CHIP_SYSTEM_CONFIG_USE_LWIP -#if CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS -typedef unsigned InterfaceId; +#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS + using PlatformType = unsigned int; + static constexpr size_t kMaxIfNameLength = IF_NAMESIZE; #endif // CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS #if CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF -typedef int InterfaceId; + using PlatformType = int; + static constexpr size_t kMaxIfNameLength = Z_DEVICE_MAX_NAME_LEN; #endif -/** - * @def INET_NULL_INTERFACEID - * - * @brief The distinguished value indicating no network interface. - * - * @details - * Note Well: This is not the indicator of a "null" network interface. This - * value can be used to indicate the absence of a specific network interface, - * or to specify that any applicable network interface is acceptable. Usage - * varies depending on context. - */ +public: + ~InterfaceId() = default; -#if CHIP_SYSTEM_CONFIG_USE_LWIP -#define INET_NULL_INTERFACEID NULL -#endif // CHIP_SYSTEM_CONFIG_USE_LWIP + constexpr InterfaceId() : mPlatformInterface(kPlatformNull) {} + explicit constexpr InterfaceId(PlatformType interface) : mPlatformInterface(interface) {} -#if CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS || CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF -#define INET_NULL_INTERFACEID 0 -#endif // CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS || CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF + constexpr InterfaceId(const InterfaceId & other) : mPlatformInterface(other.mPlatformInterface) {} + constexpr InterfaceId & operator=(const InterfaceId & other) + { + mPlatformInterface = other.mPlatformInterface; + return *this; + } -/** - * @brief Test \c ID for inequivalence with \c INET_NULL_INTERFACEID - * - * @details - * This macro resolves to an expression that evaluates \c false if the - * argument is equivalent to \c INET_NULL_INTERFACEID and \c true otherwise. - */ -#define IsInterfaceIdPresent(intfId) ((intfId) != INET_NULL_INTERFACEID) + static constexpr InterfaceId Null() { return InterfaceId(); } -/** - * Get the name of the network interface - * - * @param[in] intfId A network interface. - * @param[in] nameBuf Region of memory to write the interface name. - * @param[in] nameBufSize Size of the region denoted by \c nameBuf. - * - * @retval CHIP_NO_ERROR Successful result, interface name written. - * @retval CHIP_ERROR_BUFFER_TOO_SMALL Buffer is too small for the interface name. - * @retval other Another system or platform error. - * - * Writes the name of the network interface as a \c NUL terminated text string at \c nameBuf. - * The name of the unspecified network interface is the empty string. - */ -extern CHIP_ERROR GetInterfaceName(InterfaceId intfId, char * nameBuf, size_t nameBufSize); + constexpr bool operator==(const InterfaceId & other) const { return mPlatformInterface == other.mPlatformInterface; } + constexpr bool operator!=(const InterfaceId & other) const { return mPlatformInterface != other.mPlatformInterface; } -/** - * Search the list of network interfaces for the indicated name. - * - * @param[in] intfName Name of the network interface to find. - * @param[out] intfId Indicator of the network interface to assign. - * - * @retval CHIP_NO_ERROR Success, network interface indicated. - * @retval INET_ERROR_UNKNOWN_INTERFACE No network interface found. - * @retval other Another system or platform error. - * - * @note - * On LwIP, this function must be called with the LwIP stack lock acquired. - */ -extern CHIP_ERROR InterfaceNameToId(const char * intfName, InterfaceId & intfId); + /** + * Test for inequivalence with the null interface. + */ + bool IsPresent() const { return mPlatformInterface != kPlatformNull; } + + /** + * Get the underlying platform representation of the interface. + */ + PlatformType GetPlatformInterface() const { return mPlatformInterface; } + + /** + * Get the name of the network interface + * + * @param[in] nameBuf Region of memory to write the interface name. + * @param[in] nameBufSize Size of the region denoted by \c nameBuf. + * + * @retval CHIP_NO_ERROR Successful result, interface name written. + * @retval CHIP_ERROR_BUFFER_TOO_SMALL Buffer is too small for the interface name. + * @retval other Another system or platform error. + * + * Writes the name of the network interface as a \c NUL terminated text string at \c nameBuf. + * The name of the unspecified network interface is the empty string. + */ + CHIP_ERROR GetInterfaceName(char * nameBuf, size_t nameBufSize) const; + + /** + * Search the list of network interfaces for the indicated name. + * + * @param[in] intfName Name of the network interface to find. + * @param[out] intfId Indicator of the network interface to assign. + * + * @retval CHIP_NO_ERROR Success, network interface indicated. + * @retval INET_ERROR_UNKNOWN_INTERFACE No network interface found. + * @retval other Another system or platform error. + * + * @note + * On LwIP, this function must be called with the LwIP stack lock acquired. + */ + static CHIP_ERROR InterfaceNameToId(const char * intfName, InterfaceId & intfId); + +private: +#if CHIP_SYSTEM_CONFIG_USE_LWIP + static constexpr PlatformType kPlatformNull = nullptr; +#endif // CHIP_SYSTEM_CONFIG_USE_LWIP + +#if CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS + static constexpr PlatformType kPlatformNull = 0; +#endif // CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS + +#if CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF + static constexpr PlatformType kPlatformNull = 0; +#endif + PlatformType mPlatformInterface; +}; /** * Compute a prefix length from a variable-length netmask. @@ -211,20 +218,15 @@ class InterfaceIterator bool Next(); /** - * NetworkInterface InterfaceIterator::GetInterfaceId(void) + * InterfaceId InterfaceIterator::GetInterfaceId(void) * * Returns the network interface id at the current iterator position. * * @retval id The current network interface id. - * @retval NetworkInterface() If advanced beyond the end of the list. + * @retval InterfaceId() If advanced beyond the end of the list. */ InterfaceId GetInterfaceId(); - /** - * @brief Deprecated alias for \c GetInterfaceId(void) - */ - InterfaceId GetInterface() { return GetInterfaceId(); } - /** * Get the name of the current network interface * @@ -264,19 +266,6 @@ class InterfaceIterator */ bool HasBroadcastAddress(); -#if CHIP_SYSTEM_CONFIG_USE_LWIP - static constexpr size_t kMaxIfNameLength = 13; // Names are formatted as %c%c%d -#elif CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS - static constexpr size_t kMaxIfNameLength = IF_NAMESIZE; -#elif CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF - static constexpr size_t kMaxIfNameLength = Z_DEVICE_MAX_NAME_LEN; -#elif defined(IFNAMSIZ) - static constexpr size_t kMaxIfNameLength = IFNAMSIZ; -#else - // No constant available here - set some reasonable size - static constexpr size_t kMaxIfNameLength = 33; -#endif - protected: #if CHIP_SYSTEM_CONFIG_USE_LWIP struct netif * mCurNetif; @@ -292,8 +281,8 @@ class InterfaceIterator #endif // CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS #if CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF - InterfaceId mCurrentId = 1; - net_if * mCurrentInterface = nullptr; + InterfaceId::PlatformType mCurrentId = 1; + net_if * mCurrentInterface = nullptr; #endif // CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF }; @@ -392,11 +381,6 @@ class DLL_EXPORT InterfaceAddressIterator */ uint8_t GetPrefixLength(); - /** - * @brief Deprecated alias for \c GetPrefixLength(void) - */ - uint8_t GetIPv6PrefixLength() { return GetPrefixLength(); } - /** * @fn void InterfaceAddressIterator::GetAddressWithPrefix(IPPrefix & addrWithPrefix) * @@ -406,21 +390,16 @@ class DLL_EXPORT InterfaceAddressIterator void GetAddressWithPrefix(IPPrefix & addrWithPrefix); /** - * @fn NetworkInterface InterfaceAddressIterator::GetInterfaceId(void) + * @fn InterfaceId InterfaceAddressIterator::GetInterfaceId(void) * * @brief Returns the network interface id associated with the current * interface address. * - * @return the interface id or \c NetworkInterface() if the iterator + * @return the interface id or \c InterfaceId() if the iterator * is positioned beyond the end of the address list. */ InterfaceId GetInterfaceId(); - /** - * @brief Deprecated alias for \c GetInterfaceId(void) - */ - InterfaceId GetInterface() { return GetInterfaceId(); } - /** * @fn CHIP_ERROR InterfaceAddressIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize) * @@ -506,7 +485,7 @@ inline bool InterfaceIterator::HasCurrent(void) inline InterfaceId InterfaceIterator::GetInterfaceId(void) { - return mCurNetif; + return InterfaceId(mCurNetif); } inline InterfaceAddressIterator::InterfaceAddressIterator(void) diff --git a/src/inet/InetLayer.cpp b/src/inet/InetLayer.cpp index b07d14a9d0542c..9cb196b9123668 100644 --- a/src/inet/InetLayer.cpp +++ b/src/inet/InetLayer.cpp @@ -345,20 +345,20 @@ bool InetLayer::IsIdleTimerRunning() /** * Get the link local IPv6 address for a specified link or interface. * - * @param[in] link The interface for which the link local IPv6 - * address is being sought. + * @param[in] interface The interface for which the link local IPv6 + * address is being sought. * * @param[out] llAddr The link local IPv6 address for the link. * * @retval #CHIP_ERROR_NOT_IMPLEMENTED If IPv6 is not supported. * @retval #CHIP_ERROR_INVALID_ARGUMENT If the link local address - * is NULL. + * is nullptr. * @retval #INET_ERROR_ADDRESS_NOT_FOUND If the link does not have * any address configured. * @retval #CHIP_NO_ERROR On success. * */ -CHIP_ERROR InetLayer::GetLinkLocalAddr(InterfaceId link, IPAddress * llAddr) +CHIP_ERROR InetLayer::GetLinkLocalAddr(InterfaceId interface, IPAddress * llAddr) { VerifyOrReturnError(llAddr != nullptr, CHIP_ERROR_INVALID_ARGUMENT); @@ -367,6 +367,7 @@ CHIP_ERROR InetLayer::GetLinkLocalAddr(InterfaceId link, IPAddress * llAddr) return CHIP_ERROR_NOT_IMPLEMENTED; #endif //! LWIP_IPV6 + struct netif * link = interface.GetPlatformInterface(); for (struct netif * intf = netif_list; intf != NULL; intf = intf->next) { if ((link != NULL) && (link != intf)) @@ -399,7 +400,7 @@ CHIP_ERROR InetLayer::GetLinkLocalAddr(InterfaceId link, IPAddress * llAddr) if (ifaddr_iter->ifa_addr != nullptr) { if ((ifaddr_iter->ifa_addr->sa_family == AF_INET6) && - ((link == INET_NULL_INTERFACEID) || (if_nametoindex(ifaddr_iter->ifa_name) == link))) + (!interface.IsPresent() || (if_nametoindex(ifaddr_iter->ifa_name) == interface.GetPlatformInterface()))) { struct in6_addr * sin6_addr = &(reinterpret_cast(ifaddr_iter->ifa_addr))->sin6_addr; if (sin6_addr->s6_addr[0] == 0xfe && (sin6_addr->s6_addr[1] & 0xc0) == 0x80) // Link Local Address @@ -414,7 +415,7 @@ CHIP_ERROR InetLayer::GetLinkLocalAddr(InterfaceId link, IPAddress * llAddr) #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS #if CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF - net_if * const iface = (link == INET_NULL_INTERFACEID) ? net_if_get_default() : net_if_get_by_index(link); + net_if * const iface = interface.IsPresent() ? net_if_get_by_index(interface.GetPlatformInterface()) : net_if_get_default(); VerifyOrReturnError(iface != nullptr, INET_ERROR_ADDRESS_NOT_FOUND); in6_addr * const ip6_addr = net_if_ipv6_get_ll(iface, NET_ADDR_PREFERRED); @@ -508,8 +509,8 @@ CHIP_ERROR InetLayer::NewUDPEndPoint(UDPEndPoint ** retEndPoint) /** * Get the interface identifier for the specified IP address. If the - * interface identifier cannot be derived it is set to the - * #INET_NULL_INTERFACEID. + * interface identifier cannot be derived it is set to the default + * InterfaceId. * * @note * This function fetches the first interface (from the configured list @@ -531,12 +532,12 @@ CHIP_ERROR InetLayer::GetInterfaceFromAddr(const IPAddress & addr, InterfaceId & IPAddress curAddr = addrIter.GetAddress(); if (addr == curAddr) { - intfId = addrIter.GetInterface(); + intfId = addrIter.GetInterfaceId(); return CHIP_NO_ERROR; } } - intfId = INET_NULL_INTERFACEID; + intfId = InterfaceId::Null(); return CHIP_NO_ERROR; } @@ -566,7 +567,7 @@ bool InetLayer::MatchLocalIPv6Subnet(const IPAddress & addr) #endif // INET_CONFIG_ENABLE_IPV4 if (addrPrefix.IPAddr.IsIPv6LinkLocal()) continue; - addrPrefix.Length = ifAddrIter.GetIPv6PrefixLength(); + addrPrefix.Length = ifAddrIter.GetPrefixLength(); if (addrPrefix.MatchAddress(addr)) return true; } @@ -674,7 +675,7 @@ void IPPacketInfo::Clear() { SrcAddress = IPAddress::Any; DestAddress = IPAddress::Any; - Interface = INET_NULL_INTERFACEID; + Interface = InterfaceId::Null(); SrcPort = 0; DestPort = 0; } diff --git a/src/inet/TCPEndPoint.cpp b/src/inet/TCPEndPoint.cpp index 5681619011728c..91c70fdc686505 100644 --- a/src/inet/TCPEndPoint.cpp +++ b/src/inet/TCPEndPoint.cpp @@ -192,7 +192,7 @@ CHIP_ERROR TCPEndPoint::ConnectImpl(const IPAddress & addr, uint16_t port, Inter // As a work-around, if the destination is an IPv6 link-local address, we bind the PCB // to the link local address associated with the source interface; however this is only // viable if the endpoint hasn't already been bound. - if (intfId != INET_NULL_INTERFACEID) + if (intfId.IsPresent()) { IPAddress intfLLAddr; InetLayer & lInetLayer = Layer(); @@ -328,7 +328,7 @@ CHIP_ERROR TCPEndPoint::GetInterfaceId(InterfaceId * retInterface) // TODO: Does netif_get_by_index(mTCP->netif_idx) do the right thing? I // can't quite tell whether LwIP supports a specific interface id for TCP at // all. For now just claim no particular interface id. - *retInterface = INET_NULL_INTERFACEID; + *retInterface = InterfaceId::Null(); return CHIP_NO_ERROR; } @@ -1258,7 +1258,7 @@ CHIP_ERROR TCPEndPoint::ConnectImpl(const IPAddress & addr, uint16_t port, Inter ReturnErrorOnFailure(GetSocket(addrType)); - if (intfId == INET_NULL_INTERFACEID) + if (!intfId.IsPresent()) { // The behavior when connecting to an IPv6 link-local address without specifying an outbound // interface is ambiguous. So prevent it in all cases. @@ -1280,7 +1280,7 @@ CHIP_ERROR TCPEndPoint::ConnectImpl(const IPAddress & addr, uint16_t port, Inter struct ::ifreq ifr; memset(&ifr, 0, sizeof(ifr)); - ReturnErrorOnFailure(GetInterfaceName(intfId, ifr.ifr_name, sizeof(ifr.ifr_name))); + ReturnErrorOnFailure(intfId.GetInterfaceName(ifr.ifr_name, sizeof(ifr.ifr_name))); // Attempt to bind to the interface using SO_BINDTODEVICE which requires privileged access. // If the permission is denied(EACCES) because CHIP is running in a context @@ -1325,7 +1325,7 @@ CHIP_ERROR TCPEndPoint::ConnectImpl(const IPAddress & addr, uint16_t port, Inter sa.in6.sin6_port = htons(port); sa.in6.sin6_flowinfo = 0; sa.in6.sin6_addr = addr.ToIPv6(); - sa.in6.sin6_scope_id = intfId; + sa.in6.sin6_scope_id = intfId.GetPlatformInterface(); sockaddrsize = sizeof(sockaddr_in6); sockaddrptr = reinterpret_cast(&sa.in6); } @@ -1439,12 +1439,12 @@ CHIP_ERROR TCPEndPoint::GetInterfaceId(InterfaceId * retInterface) { if (IPAddress(sa.in6.sin6_addr).IsIPv6LinkLocal()) { - *retInterface = sa.in6.sin6_scope_id; + *retInterface = InterfaceId(sa.in6.sin6_scope_id); } else { // TODO: Is there still a meaningful interface id in this case? - *retInterface = INET_NULL_INTERFACEID; + *retInterface = InterfaceId::Null(); } return CHIP_NO_ERROR; } @@ -1453,12 +1453,12 @@ CHIP_ERROR TCPEndPoint::GetInterfaceId(InterfaceId * retInterface) if (sa.any.sa_family == AF_INET) { // No interface id available for IPv4 sockets. - *retInterface = INET_NULL_INTERFACEID; + *retInterface = InterfaceId::Null(); return CHIP_NO_ERROR; } #endif // INET_CONFIG_ENABLE_IPV4 - *retInterface = INET_NULL_INTERFACEID; + *retInterface = InterfaceId::Null(); return INET_ERROR_WRONG_ADDRESS_TYPE; } @@ -1832,7 +1832,7 @@ CHIP_ERROR TCPEndPoint::BindSrcAddrFromIntf(IPAddressType addrType, InterfaceId for (InterfaceAddressIterator addrIter; addrIter.HasCurrent(); addrIter.Next()) { const IPAddress curAddr = addrIter.GetAddress(); - const InterfaceId curIntfId = addrIter.GetInterface(); + const InterfaceId curIntfId = addrIter.GetInterfaceId(); if (curIntfId == intfId) { diff --git a/src/inet/TCPEndPoint.h b/src/inet/TCPEndPoint.h index 0dcad952a21876..77eab7408f9b85 100644 --- a/src/inet/TCPEndPoint.h +++ b/src/inet/TCPEndPoint.h @@ -140,7 +140,7 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis * destination \c addr (with \c intfId used as the scope * identifier for IPv6 link-local destinations) and \c port. */ - CHIP_ERROR Connect(const IPAddress & addr, uint16_t port, InterfaceId intfId = INET_NULL_INTERFACEID); + CHIP_ERROR Connect(const IPAddress & addr, uint16_t port, InterfaceId intfId = InterfaceId::Null()); /** * @brief Extract IP address and TCP port of remote endpoint. diff --git a/src/inet/UDPEndPoint.cpp b/src/inet/UDPEndPoint.cpp index e6ff19e044e30f..39c3d947b13104 100644 --- a/src/inet/UDPEndPoint.cpp +++ b/src/inet/UDPEndPoint.cpp @@ -93,7 +93,7 @@ CHIP_ERROR LwIPBindInterface(struct udp_pcb * aUDP, InterfaceId intfId) CHIP_ERROR res = CHIP_NO_ERROR; #if HAVE_LWIP_UDP_BIND_NETIF - if (!IsInterfaceIdPresent(intfId)) + if (!intfId.IsPresent()) udp_bind_netif(aUDP, NULL); else { @@ -105,7 +105,7 @@ CHIP_ERROR LwIPBindInterface(struct udp_pcb * aUDP, InterfaceId intfId) udp_bind_netif(aUDP, netifp); } #else - if (!IsInterfaceIdPresent(intfId)) + if (!intfId.IsPresent()) aUDP->intf_filter = NULL; else { @@ -202,9 +202,9 @@ CHIP_ERROR UDPEndPoint::BindInterfaceImpl(IPAddressType addrType, InterfaceId in InterfaceId UDPEndPoint::GetBoundInterface() { #if HAVE_LWIP_UDP_BIND_NETIF - return netif_get_by_index(mUDP->netif_idx); + return InterfaceId(netif_get_by_index(mUDP->netif_idx)); #else - return mUDP->intf_filter; + return InterfaceId(mUDP->intf_filter); #endif } @@ -283,8 +283,9 @@ CHIP_ERROR UDPEndPoint::SendMsgImpl(const IPPacketInfo * pktInfo, System::Packet ip_addr_copy(mUDP->local_ip, lwipSrcAddr); } - if (intfId != INET_NULL_INTERFACEID) - lwipErr = udp_sendto_if(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort, intfId); + if (intfId.IsPresent()) + lwipErr = udp_sendto_if(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort, + intfId.GetPlatformInterface()); else lwipErr = udp_sendto(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort); @@ -305,7 +306,7 @@ CHIP_ERROR UDPEndPoint::SendMsgImpl(const IPPacketInfo * pktInfo, System::Packet ipX_addr_copy(mUDP->local_ip, *ip6_2_ipX(&lwipSrcAddr)); } - if (intfId != INET_NULL_INTERFACEID) + if (intfId.IsPresent()) lwipErr = udp_sendto_if_ip6(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort, intfId); else @@ -325,7 +326,7 @@ CHIP_ERROR UDPEndPoint::SendMsgImpl(const IPPacketInfo * pktInfo, System::Packet ipX_addr_copy(mUDP->local_ip, *ip_2_ipX(&lwipSrcAddr)); } - if (intfId != INET_NULL_INTERFACEID) + if (intfId.IsPresent()) lwipErr = udp_sendto_if(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort, intfId); else lwipErr = udp_sendto(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort); @@ -502,7 +503,7 @@ void UDPEndPoint::LwIPReceiveUDPMessage(void * arg, struct udp_pcb * pcb, struct #endif // INET_CONFIG_ENABLE_IPV4 #endif // LWIP_VERSION_MAJOR <= 1 - pktInfo->Interface = ip_current_netif(); + pktInfo->Interface = InterfaceId(ip_current_netif()); pktInfo->SrcPort = port; pktInfo->DestPort = pcb->local_port; } @@ -658,7 +659,7 @@ CHIP_ERROR UDPEndPoint::BindImpl(IPAddressType addrType, const IPAddress & addr, nw_parameters_configure_protocol_block_t configure_tls; nw_parameters_t parameters; - if (intfId != INET_NULL_INTERFACEID) + if (intfId.IsPresent()) { return CHIP_ERROR_NOT_IMPLEMENTED; } @@ -679,7 +680,7 @@ CHIP_ERROR UDPEndPoint::BindInterfaceImpl(IPAddressType addrType, InterfaceId in InterfaceId UDPEndPoint::GetBoundInterface() { - return INET_NULL_INTERFACEID; + return InterfaceId::Null(); } uint16_t UDPEndPoint::GetBoundPort() diff --git a/src/inet/UDPEndPoint.h b/src/inet/UDPEndPoint.h index c5b522fd61fb1c..a19a05b4bf6c04 100644 --- a/src/inet/UDPEndPoint.h +++ b/src/inet/UDPEndPoint.h @@ -78,7 +78,7 @@ class DLL_EXPORT UDPEndPoint : public IPEndPointBasis * @retval INET_ERROR_WRONG_ADDRESS_TYPE \c addrType is \c IPAddressType::kAny, or not equal to the type of \c addr. * @retval other Another system or platform error */ - CHIP_ERROR Bind(IPAddressType addrType, const IPAddress & addr, uint16_t port, InterfaceId intfId = INET_NULL_INTERFACEID); + CHIP_ERROR Bind(IPAddressType addrType, const IPAddress & addr, uint16_t port, InterfaceId intfId = InterfaceId::Null()); /** * Bind the endpoint to a network interface. @@ -146,7 +146,7 @@ class DLL_EXPORT UDPEndPoint : public IPEndPointBasis * @retval other Another system or platform error. */ CHIP_ERROR SendTo(const IPAddress & addr, uint16_t port, chip::System::PacketBufferHandle && msg, - InterfaceId intfId = INET_NULL_INTERFACEID); + InterfaceId intfId = InterfaceId::Null()); /** * Send a UDP message to a specified destination. diff --git a/src/inet/tests/TestInetCommonPosix.cpp b/src/inet/tests/TestInetCommonPosix.cpp index 4895ac369c6bff..27b1555e1149df 100644 --- a/src/inet/tests/TestInetCommonPosix.cpp +++ b/src/inet/tests/TestInetCommonPosix.cpp @@ -174,7 +174,7 @@ void ShutdownSystemLayer() #if CHIP_SYSTEM_CONFIG_USE_LWIP static void PrintNetworkState() { - char intfName[chip::Inet::InterfaceIterator::kMaxIfNameLength]; + char intfName[chip::Inet::InterfaceId::kMaxIfNameLength]; for (size_t j = 0; j < gNetworkOptions.TapDeviceName.size(); j++) { @@ -187,7 +187,7 @@ static void PrintNetworkState() TapInterface * tapIF = &(sTapIFs[j]); #endif // CHIP_TARGET_STYLE_UNIX - GetInterfaceName(netIF, intfName, sizeof(intfName)); + InterfaceId(netIF).GetInterfaceName(intfName, sizeof(intfName)); printf("LwIP interface ready\n"); printf(" Interface Name: %s\n", intfName); diff --git a/src/inet/tests/TestInetEndPoint.cpp b/src/inet/tests/TestInetEndPoint.cpp index 8e8aa8148116b5..48bd06561a4d9b 100644 --- a/src/inet/tests/TestInetEndPoint.cpp +++ b/src/inet/tests/TestInetEndPoint.cpp @@ -127,23 +127,23 @@ static void TestInetInterface(nlTestSuite * inSuite, void * inContext) { InterfaceIterator intIterator; InterfaceAddressIterator addrIterator; - char intName[chip::Inet::InterfaceIterator::kMaxIfNameLength]; + char intName[chip::Inet::InterfaceId::kMaxIfNameLength]; InterfaceId intId; IPAddress addr; IPPrefix addrWithPrefix; CHIP_ERROR err; - err = InterfaceNameToId("0", intId); + err = InterfaceId::InterfaceNameToId("0", intId); NL_TEST_ASSERT(inSuite, err != CHIP_NO_ERROR); - err = GetInterfaceName(INET_NULL_INTERFACEID, intName, 0); - NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_NO_MEMORY); + err = InterfaceId::Null().GetInterfaceName(intName, 0); + NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_BUFFER_TOO_SMALL); - err = GetInterfaceName(INET_NULL_INTERFACEID, intName, sizeof(intName)); + err = InterfaceId::Null().GetInterfaceName(intName, sizeof(intName)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR && intName[0] == '\0'); err = gInet.GetInterfaceFromAddr(addr, intId); - NL_TEST_ASSERT(inSuite, intId == INET_NULL_INTERFACEID); + NL_TEST_ASSERT(inSuite, !intId.IsPresent()); err = gInet.GetLinkLocalAddr(intId, nullptr); NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INVALID_ARGUMENT); @@ -151,16 +151,16 @@ static void TestInetInterface(nlTestSuite * inSuite, void * inContext) printf(" Interfaces:\n"); for (; intIterator.HasCurrent(); intIterator.Next()) { - intId = intIterator.GetInterface(); - NL_TEST_ASSERT(inSuite, intId != INET_NULL_INTERFACEID); + intId = intIterator.GetInterfaceId(); + NL_TEST_ASSERT(inSuite, intId.IsPresent()); memset(intName, 42, sizeof(intName)); err = intIterator.GetInterfaceName(intName, sizeof(intName)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); printf(" interface id: 0x%" PRIxPTR ", interface name: %s, interface state: %s, %s multicast, %s broadcast addr\n", #if CHIP_SYSTEM_CONFIG_USE_LWIP - reinterpret_cast(intId), + reinterpret_cast(intId.GetPlatformInterface()), #else - static_cast(intId), + static_cast(intId.GetPlatformInterface()), #endif intName, intIterator.IsUp() ? "UP" : "DOWN", intIterator.SupportsMulticast() ? "supports" : "no", intIterator.HasBroadcastAddress() ? "has" : "no"); @@ -169,7 +169,7 @@ static void TestInetInterface(nlTestSuite * inSuite, void * inContext) gInet.MatchLocalIPv6Subnet(addr); } NL_TEST_ASSERT(inSuite, !intIterator.Next()); - NL_TEST_ASSERT(inSuite, intIterator.GetInterface() == INET_NULL_INTERFACEID); + NL_TEST_ASSERT(inSuite, intIterator.GetInterfaceId() == InterfaceId::Null()); NL_TEST_ASSERT(inSuite, intIterator.GetInterfaceName(intName, sizeof(intName)) == CHIP_ERROR_INCORRECT_STATE); NL_TEST_ASSERT(inSuite, !intIterator.SupportsMulticast()); NL_TEST_ASSERT(inSuite, !intIterator.HasBroadcastAddress()); @@ -182,7 +182,7 @@ static void TestInetInterface(nlTestSuite * inSuite, void * inContext) char addrStr[80]; addrWithPrefix.IPAddr.ToString(addrStr); intId = addrIterator.GetInterfaceId(); - NL_TEST_ASSERT(inSuite, intId != INET_NULL_INTERFACEID); + NL_TEST_ASSERT(inSuite, intId.IsPresent()); memset(intName, 42, sizeof(intName)); err = addrIterator.GetInterfaceName(intName, sizeof(intName)); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); @@ -191,9 +191,9 @@ static void TestInetInterface(nlTestSuite * inSuite, void * inContext) ", interface name: %s, interface state: %s, %s multicast, %s broadcast addr\n", addrStr, addrWithPrefix.Length, #if CHIP_SYSTEM_CONFIG_USE_LWIP - reinterpret_cast(intId), + reinterpret_cast(intId.GetPlatformInterface()), #else - static_cast(intId), + static_cast(intId.GetPlatformInterface()), #endif intName, addrIterator.IsUp() ? "UP" : "DOWN", addrIterator.SupportsMulticast() ? "supports" : "no", addrIterator.HasBroadcastAddress() ? "has" : "no"); @@ -201,7 +201,7 @@ static void TestInetInterface(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, !addrIterator.Next()); addrIterator.GetAddressWithPrefix(addrWithPrefix); NL_TEST_ASSERT(inSuite, addrWithPrefix.IsZero()); - NL_TEST_ASSERT(inSuite, addrIterator.GetInterface() == INET_NULL_INTERFACEID); + NL_TEST_ASSERT(inSuite, addrIterator.GetInterfaceId() == InterfaceId::Null()); NL_TEST_ASSERT(inSuite, addrIterator.GetInterfaceName(intName, sizeof(intName)) == CHIP_ERROR_INCORRECT_STATE); NL_TEST_ASSERT(inSuite, !addrIterator.SupportsMulticast()); NL_TEST_ASSERT(inSuite, !addrIterator.HasBroadcastAddress()); @@ -229,7 +229,7 @@ static void TestInetEndPointInternal(nlTestSuite * inSuite, void * inContext) err = gInet.NewTCPEndPoint(&testTCPEP1); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = gInet.GetLinkLocalAddr(INET_NULL_INTERFACEID, &addr); + err = gInet.GetLinkLocalAddr(InterfaceId::Null(), &addr); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); err = gInet.GetInterfaceFromAddr(addr, intId); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); diff --git a/src/inet/tests/TestInetLayer.cpp b/src/inet/tests/TestInetLayer.cpp index ee3ff88a3ef303..5a2ca21237d8ca 100644 --- a/src/inet/tests/TestInetLayer.cpp +++ b/src/inet/tests/TestInetLayer.cpp @@ -277,7 +277,7 @@ int main(int argc, char * argv[]) if (gInterfaceName != nullptr) { - lStatus = InterfaceNameToId(gInterfaceName, gInterfaceId); + lStatus = InterfaceId::InterfaceNameToId(gInterfaceName, gInterfaceId); if (lStatus != CHIP_NO_ERROR) { PrintArgError("%s: unknown network interface %s\n", kToolName, gInterfaceName); @@ -823,7 +823,7 @@ static void StartTest() lStatus = gInet.NewUDPEndPoint(&sUDPIPEndPoint); INET_FAIL_ERROR(lStatus, "InetLayer::NewUDPEndPoint failed"); - if (IsInterfaceIdPresent(gInterfaceId)) + if (gInterfaceId.IsPresent()) { lStatus = sUDPIPEndPoint->BindInterface(lIPAddressType, gInterfaceId); INET_FAIL_ERROR(lStatus, "UDPEndPoint::BindInterface failed"); diff --git a/src/inet/tests/TestInetLayerCommon.cpp b/src/inet/tests/TestInetLayerCommon.cpp index fdbbfec1c2517c..609acf9f14ee50 100644 --- a/src/inet/tests/TestInetLayerCommon.cpp +++ b/src/inet/tests/TestInetLayerCommon.cpp @@ -85,7 +85,7 @@ uint32_t gSendIntervalMs = 1000; const char * gInterfaceName = nullptr; -InterfaceId gInterfaceId = INET_NULL_INTERFACEID; +InterfaceId gInterfaceId = InterfaceId::Null(); uint16_t gSendSize = 59; diff --git a/src/inet/tests/TestInetLayerMulticast.cpp b/src/inet/tests/TestInetLayerMulticast.cpp index 7e2ad4d8b32b9e..eaaf6b429db143 100644 --- a/src/inet/tests/TestInetLayerMulticast.cpp +++ b/src/inet/tests/TestInetLayerMulticast.cpp @@ -288,7 +288,7 @@ int main(int argc, char * argv[]) if (gInterfaceName != nullptr) { - lStatus = InterfaceNameToId(gInterfaceName, gInterfaceId); + lStatus = InterfaceId::InterfaceNameToId(gInterfaceName, gInterfaceId); if (lStatus != CHIP_NO_ERROR) { PrintArgError("%s: unknown network interface %s\n", kToolName, gInterfaceName); @@ -300,7 +300,7 @@ int main(int argc, char * argv[]) // If any multicast groups have been specified, ensure that a // network interface identifier has been specified and is valid. - if ((sGroupAddresses.mSize > 0) && !IsInterfaceIdPresent(gInterfaceId)) + if ((sGroupAddresses.mSize > 0) && !gInterfaceId.IsPresent()) { PrintArgError("%s: a network interface is required when specifying one or more multicast groups\n", kToolName); lSuccessful = false; @@ -749,7 +749,7 @@ static void StartTest() lStatus = sUDPIPEndPoint->Bind(lIPAddressType, lAddress, kUDPPort); INET_FAIL_ERROR(lStatus, "UDPEndPoint::Bind failed"); - if (IsInterfaceIdPresent(gInterfaceId)) + if (gInterfaceId.IsPresent()) { lStatus = sUDPIPEndPoint->BindInterface(lIPAddressType, gInterfaceId); INET_FAIL_ERROR(lStatus, "UDPEndPoint::BindInterface failed"); @@ -775,7 +775,7 @@ static void StartTest() GroupAddress & lGroupAddress = sGroupAddresses.mAddresses[i]; IPAddress & lMulticastAddress = lGroupAddress.mMulticastAddress; - if ((lEndPoint != nullptr) && IsInterfaceIdPresent(gInterfaceId)) + if ((lEndPoint != nullptr) && gInterfaceId.IsPresent()) { if (gOptFlags & kOptFlagUseIPv4) { @@ -822,7 +822,7 @@ static void CleanupTest() GroupAddress & lGroupAddress = sGroupAddresses.mAddresses[i]; IPAddress & lMulticastAddress = lGroupAddress.mMulticastAddress; - if ((lEndPoint != nullptr) && IsInterfaceIdPresent(gInterfaceId)) + if ((lEndPoint != nullptr) && gInterfaceId.IsPresent()) { lMulticastAddress.ToString(lAddressBuffer, sizeof(lAddressBuffer)); diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h index 5c07ad56e18601..2003bb0418ce2d 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -2207,6 +2207,15 @@ using CHIP_ERROR = ::chip::ChipError; */ #define CHIP_ERROR_IM_STATUS_CODE_RECEIVED CHIP_CORE_ERROR(0xca) +/* + * @def CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS + * + * @brief + * Indicates that the commissioning window on the device is already open, and another + * commissioning is in progress + */ +#define CHIP_ERROR_ANOTHER_COMMISSIONING_IN_PROGRESS CHIP_CORE_ERROR(0xcb) + /** * @} */ diff --git a/src/lib/core/CHIPTLV.h b/src/lib/core/CHIPTLV.h index b68d59bdeb87c5..9bfcc89ea1f004 100644 --- a/src/lib/core/CHIPTLV.h +++ b/src/lib/core/CHIPTLV.h @@ -466,6 +466,26 @@ class DLL_EXPORT TLVReader */ CHIP_ERROR Get(ByteSpan & v); + /** + * Get the value of the current element as a FixedByteSpan + * + * @param[out] v Receives the value associated with current TLV element. + * + * @retval #CHIP_NO_ERROR If the method succeeded. + * @retval #CHIP_ERROR_WRONG_TLV_TYPE If the current element is not a TLV bytes array, or + * the reader is not positioned on an element. + * + */ + template + CHIP_ERROR Get(FixedByteSpan & v) + { + const uint8_t * val; + ReturnErrorOnFailure(GetDataPtr(val)); + VerifyOrReturnError(GetLength() == N, CHIP_ERROR_UNEXPECTED_TLV_ELEMENT); + v = FixedByteSpan(val); + return CHIP_NO_ERROR; + } + /** * Get the value of the current element as a CharSpan * diff --git a/src/lib/dnssd/AllInterfacesListenIterator.h b/src/lib/dnssd/AllInterfacesListenIterator.h index f16a4efe74c2d5..7366a3ca037605 100644 --- a/src/lib/dnssd/AllInterfacesListenIterator.h +++ b/src/lib/dnssd/AllInterfacesListenIterator.h @@ -33,7 +33,7 @@ bool IsCurrentInterfaceUsable(T & iterator) { return false; // not a usable interface } - char name[chip::Inet::InterfaceIterator::kMaxIfNameLength]; + char name[chip::Inet::InterfaceId::kMaxIfNameLength]; if (iterator.GetInterfaceName(name, sizeof(name)) != CHIP_NO_ERROR) { ChipLogError(Discovery, "Failed to get interface name."); diff --git a/src/lib/dnssd/Discovery_ImplPlatform.cpp b/src/lib/dnssd/Discovery_ImplPlatform.cpp index 8280575aa49cf2..2402371dbfcbdf 100644 --- a/src/lib/dnssd/Discovery_ImplPlatform.cpp +++ b/src/lib/dnssd/Discovery_ImplPlatform.cpp @@ -345,7 +345,7 @@ CHIP_ERROR DiscoveryImplPlatform::Advertise(const CommissionAdvertisingParameter service.mTextEntries = textEntries; service.mTextEntrySize = textEntrySize; service.mPort = params.GetPort(); - service.mInterface = INET_NULL_INTERFACEID; + service.mInterface = Inet::InterfaceId::Null(); service.mSubTypes = subTypes; service.mSubTypeSize = subTypeSize; service.mAddressType = Inet::IPAddressType::kAny; @@ -427,7 +427,7 @@ CHIP_ERROR DiscoveryImplPlatform::Advertise(const OperationalAdvertisingParamete service.mPort = params.GetPort(); service.mTextEntries = txtEntries; service.mTextEntrySize = textEntrySize; - service.mInterface = INET_NULL_INTERFACEID; + service.mInterface = Inet::InterfaceId::Null(); service.mAddressType = Inet::IPAddressType::kAny; service.mSubTypes = subTypes; service.mSubTypeSize = subTypeSize; @@ -489,7 +489,7 @@ CHIP_ERROR DiscoveryImplPlatform::ResolveNodeId(const PeerId & peerId, Inet::IPA strncpy(service.mType, kOperationalServiceName, sizeof(service.mType)); service.mProtocol = DnssdServiceProtocol::kDnssdProtocolTcp; service.mAddressType = type; - return ChipDnssdResolve(&service, INET_NULL_INTERFACEID, HandleNodeIdResolve, this); + return ChipDnssdResolve(&service, Inet::InterfaceId::Null(), HandleNodeIdResolve, this); } void DiscoveryImplPlatform::HandleNodeBrowse(void * context, DnssdService * services, size_t servicesSize, CHIP_ERROR error) @@ -542,8 +542,8 @@ CHIP_ERROR DiscoveryImplPlatform::FindCommissionableNodes(DiscoveryFilter filter char serviceName[kMaxCommisisonableServiceNameSize]; ReturnErrorOnFailure(MakeServiceTypeName(serviceName, sizeof(serviceName), filter, DiscoveryType::kCommissionableNode)); - return ChipDnssdBrowse(serviceName, DnssdServiceProtocol::kDnssdProtocolUdp, Inet::IPAddressType::kAny, INET_NULL_INTERFACEID, - HandleNodeBrowse, this); + return ChipDnssdBrowse(serviceName, DnssdServiceProtocol::kDnssdProtocolUdp, Inet::IPAddressType::kAny, + Inet::InterfaceId::Null(), HandleNodeBrowse, this); } CHIP_ERROR DiscoveryImplPlatform::FindCommissioners(DiscoveryFilter filter) @@ -552,8 +552,8 @@ CHIP_ERROR DiscoveryImplPlatform::FindCommissioners(DiscoveryFilter filter) char serviceName[kMaxCommisisonerServiceNameSize]; ReturnErrorOnFailure(MakeServiceTypeName(serviceName, sizeof(serviceName), filter, DiscoveryType::kCommissionerNode)); - return ChipDnssdBrowse(serviceName, DnssdServiceProtocol::kDnssdProtocolUdp, Inet::IPAddressType::kAny, INET_NULL_INTERFACEID, - HandleNodeBrowse, this); + return ChipDnssdBrowse(serviceName, DnssdServiceProtocol::kDnssdProtocolUdp, Inet::IPAddressType::kAny, + Inet::InterfaceId::Null(), HandleNodeBrowse, this); } void DiscoveryImplPlatform::HandleNodeIdResolve(void * context, DnssdService * result, CHIP_ERROR error) diff --git a/src/lib/dnssd/MinimalMdnsServer.h b/src/lib/dnssd/MinimalMdnsServer.h index 7ef750891b86e8..8f80d0f1960732 100644 --- a/src/lib/dnssd/MinimalMdnsServer.h +++ b/src/lib/dnssd/MinimalMdnsServer.h @@ -30,7 +30,7 @@ bool IsCurrentInterfaceUsable(T & iterator) { return false; // not a usable interface } - char name[chip::Inet::InterfaceIterator::kMaxIfNameLength]; + char name[chip::Inet::InterfaceId::kMaxIfNameLength]; if (iterator.GetInterfaceName(name, sizeof(name)) != CHIP_NO_ERROR) { ChipLogError(Discovery, "Failed to get interface name."); diff --git a/src/lib/dnssd/Resolver.h b/src/lib/dnssd/Resolver.h index 4102b6d016e3fa..977ee0cf5aecfc 100644 --- a/src/lib/dnssd/Resolver.h +++ b/src/lib/dnssd/Resolver.h @@ -63,7 +63,7 @@ struct ResolvedNodeData PeerId mPeerId; Inet::IPAddress mAddress = Inet::IPAddress::Any; - Inet::InterfaceId mInterfaceId = INET_NULL_INTERFACEID; + Inet::InterfaceId mInterfaceId = Inet::InterfaceId::Null(); uint16_t mPort = 0; char mHostName[kHostNameMaxLength + 1] = {}; bool mSupportsTcp = false; diff --git a/src/lib/dnssd/Resolver_ImplMinimalMdns.cpp b/src/lib/dnssd/Resolver_ImplMinimalMdns.cpp index d4e3583cf0a3fe..6bc0aa2df2b817 100644 --- a/src/lib/dnssd/Resolver_ImplMinimalMdns.cpp +++ b/src/lib/dnssd/Resolver_ImplMinimalMdns.cpp @@ -513,14 +513,14 @@ CHIP_ERROR MinMdnsResolver::ScheduleResolveRetries() ReturnErrorCodeIf(mSystemLayer == nullptr, CHIP_ERROR_INCORRECT_STATE); mSystemLayer->CancelTimer(&ResolveRetryCallback, this); - Optional delayMs = mActiveResolves.GetMsUntilNextExpectedResponse(); + Optional delay = mActiveResolves.GetTimeUntilNextExpectedResponse(); - if (!delayMs.HasValue()) + if (!delay.HasValue()) { return CHIP_NO_ERROR; } - return mSystemLayer->StartTimer(System::Clock::Milliseconds32(delayMs.Value()), &ResolveRetryCallback, this); + return mSystemLayer->StartTimer(delay.Value(), &ResolveRetryCallback, this); } void MinMdnsResolver::ResolveRetryCallback(System::Layer *, void * self) diff --git a/src/lib/dnssd/minimal_mdns/ActiveResolveAttempts.cpp b/src/lib/dnssd/minimal_mdns/ActiveResolveAttempts.cpp index 1cec24734f6fb5..a4fe759925a1a7 100644 --- a/src/lib/dnssd/minimal_mdns/ActiveResolveAttempts.cpp +++ b/src/lib/dnssd/minimal_mdns/ActiveResolveAttempts.cpp @@ -26,6 +26,8 @@ using namespace chip; namespace mdns { namespace Minimal { +constexpr chip::System::Clock::Timeout ActiveResolveAttempts::kMaxRetryDelay; + void ActiveResolveAttempts::Reset() { @@ -56,9 +58,9 @@ void ActiveResolveAttempts::MarkPending(const PeerId & peerId) // Strategy when picking the peer id to use: // 1 if a matching peer id is already found, use that one // 2 if an 'unused' entry is found, use that - // 3 otherwise expire the one with the largest nextRetryDelaySec - // or if equal nextRetryDelaySec, pick the one with the oldest - // queryDueTimeMs + // 3 otherwise expire the one with the largest nextRetryDelay + // or if equal nextRetryDelay, pick the one with the oldest + // queryDueTime RetryEntry * entryToUse = &mRetryQueue[0]; @@ -94,12 +96,11 @@ void ActiveResolveAttempts::MarkPending(const PeerId & peerId) // - on same delay, use queryDueTime to determine the oldest request // (the one with the smallest due time was issued the longest time // ago) - if (entry->nextRetryDelaySec > entryToUse->nextRetryDelaySec) + if (entry->nextRetryDelay > entryToUse->nextRetryDelay) { entryToUse = entry; } - else if ((entry->nextRetryDelaySec == entryToUse->nextRetryDelaySec) && - (entry->queryDueTimeMs < entryToUse->queryDueTimeMs)) + else if ((entry->nextRetryDelay == entryToUse->nextRetryDelay) && (entry->queryDueTime < entryToUse->queryDueTime)) { entryToUse = entry; } @@ -117,16 +118,16 @@ void ActiveResolveAttempts::MarkPending(const PeerId & peerId) ChipLogError(Discovery, "Re-using pending resolve entry before reply was received."); } - entryToUse->peerId = peerId; - entryToUse->queryDueTimeMs = mClock->GetMonotonicMilliseconds(); - entryToUse->nextRetryDelaySec = 1; + entryToUse->peerId = peerId; + entryToUse->queryDueTime = mClock->GetMonotonicTimestamp(); + entryToUse->nextRetryDelay = System::Clock::Seconds16(1); } -Optional ActiveResolveAttempts::GetMsUntilNextExpectedResponse() const +Optional ActiveResolveAttempts::GetTimeUntilNextExpectedResponse() const { - Optional minDelay = Optional::Missing(); + Optional minDelay = Optional::Missing(); - chip::System::Clock::MonotonicMilliseconds nowMs = mClock->GetMonotonicMilliseconds(); + chip::System::Clock::Timestamp now = mClock->GetMonotonicTimestamp(); for (auto & entry : mRetryQueue) { @@ -135,13 +136,13 @@ Optional ActiveResolveAttempts::GetMsUntilNextExpectedResponse() const continue; } - if (nowMs >= entry.queryDueTimeMs) + if (now >= entry.queryDueTime) { // found an entry that needs processing right now - return Optional::Value(0); + return Optional::Value(0); } - uint32_t entryDelay = static_cast(entry.queryDueTimeMs - nowMs); + System::Clock::Timeout entryDelay = entry.queryDueTime - now; if (!minDelay.HasValue() || (minDelay.Value() > entryDelay)) { minDelay.SetValue(entryDelay); @@ -153,7 +154,7 @@ Optional ActiveResolveAttempts::GetMsUntilNextExpectedResponse() const Optional ActiveResolveAttempts::NextScheduledPeer() { - chip::System::Clock::MonotonicMilliseconds nowMs = mClock->GetMonotonicMilliseconds(); + chip::System::Clock::Timestamp now = mClock->GetMonotonicTimestamp(); for (auto & entry : mRetryQueue) { @@ -162,20 +163,20 @@ Optional ActiveResolveAttempts::NextScheduledPeer() continue; // not a pending item } - if (entry.queryDueTimeMs > nowMs) + if (entry.queryDueTime > now) { continue; // not yet due } - if (entry.nextRetryDelaySec > kMaxRetryDelaySec) + if (entry.nextRetryDelay > kMaxRetryDelay) { ChipLogError(Discovery, "Timeout waiting for mDNS resolution."); entry.peerId.SetNodeId(kUndefinedNodeId); continue; } - entry.queryDueTimeMs = nowMs + entry.nextRetryDelaySec * 1000L; - entry.nextRetryDelaySec *= 2; + entry.queryDueTime = now + entry.nextRetryDelay; + entry.nextRetryDelay *= 2; return Optional::Value(entry.peerId); } diff --git a/src/lib/dnssd/minimal_mdns/ActiveResolveAttempts.h b/src/lib/dnssd/minimal_mdns/ActiveResolveAttempts.h index ff09aeae690313..e0e90a06cab5da 100644 --- a/src/lib/dnssd/minimal_mdns/ActiveResolveAttempts.h +++ b/src/lib/dnssd/minimal_mdns/ActiveResolveAttempts.h @@ -38,8 +38,8 @@ namespace Minimal { class ActiveResolveAttempts { public: - static constexpr size_t kRetryQueueSize = 4; - static constexpr uint32_t kMaxRetryDelaySec = 16; + static constexpr size_t kRetryQueueSize = 4; + static constexpr chip::System::Clock::Timeout kMaxRetryDelay = chip::System::Clock::Seconds16(16); ActiveResolveAttempts(chip::System::Clock::ClockBase * clock) : mClock(clock) { Reset(); } @@ -55,10 +55,10 @@ class ActiveResolveAttempts /// by NextScheduledPeer (potentially with others as well) void MarkPending(const chip::PeerId & peerId); - // Get minimum milliseconds until the next pending reply is required. + // Get minimum time until the next pending reply is required. // // Returns missing if no actively tracked elements exist. - chip::Optional GetMsUntilNextExpectedResponse() const; + chip::Optional GetTimeUntilNextExpectedResponse() const; // Get the peer Id that needs scheduling for a query // @@ -79,7 +79,7 @@ class ActiveResolveAttempts chip::PeerId peerId; // When a reply is expected for this item - chip::System::Clock::MonotonicMilliseconds queryDueTimeMs; + chip::System::Clock::Timestamp queryDueTime; // Next expected delay for sending if reply is not reached by // 'queryDueTimeMs' @@ -89,7 +89,7 @@ class ActiveResolveAttempts // one second // - the intervals between successive queries MUST increase by at // least a factor of two - uint32_t nextRetryDelaySec = 1; + chip::System::Clock::Timeout nextRetryDelay = chip::System::Clock::Seconds16(1); }; chip::System::Clock::ClockBase * mClock; diff --git a/src/lib/dnssd/minimal_mdns/ResponseSender.cpp b/src/lib/dnssd/minimal_mdns/ResponseSender.cpp index 41d80a89ad4a7f..2a7378e294889e 100644 --- a/src/lib/dnssd/minimal_mdns/ResponseSender.cpp +++ b/src/lib/dnssd/minimal_mdns/ResponseSender.cpp @@ -89,7 +89,7 @@ CHIP_ERROR ResponseSender::Respond(uint32_t messageId, const QueryData & query, // send all 'Answer' replies { - const uint64_t kTimeNowMs = chip::System::SystemClock().GetMonotonicMilliseconds(); + const chip::System::Clock::Timestamp kTimeNow = chip::System::SystemClock().GetMonotonicTimestamp(); QueryReplyFilter queryReplyFilter(query); QueryResponderRecordFilter responseFilter; @@ -102,8 +102,7 @@ CHIP_ERROR ResponseSender::Respond(uint32_t messageId, const QueryData & query, // // TODO: the 'last sent' value does NOT track the interface we used to send, so this may cause // broadcasts on one interface to throttle broadcasts on another interface. - constexpr uint64_t kOneSecondMs = 1000; - responseFilter.SetIncludeOnlyMulticastBeforeMS(kTimeNowMs - kOneSecondMs); + responseFilter.SetIncludeOnlyMulticastBeforeMS(kTimeNow - chip::System::Clock::Seconds32(1)); } for (size_t i = 0; i < kMaxQueryResponders; ++i) { @@ -120,7 +119,7 @@ CHIP_ERROR ResponseSender::Respond(uint32_t messageId, const QueryData & query, if (!mSendState.SendUnicast()) { - it->lastMulticastTime = kTimeNowMs; + it->lastMulticastTime = kTimeNow; } } } diff --git a/src/lib/dnssd/minimal_mdns/Server.cpp b/src/lib/dnssd/minimal_mdns/Server.cpp index 7dc2ba09f0f3da..8e95b604eb81c5 100644 --- a/src/lib/dnssd/minimal_mdns/Server.cpp +++ b/src/lib/dnssd/minimal_mdns/Server.cpp @@ -154,7 +154,7 @@ CHIP_ERROR ServerBase::Listen(chip::Inet::InetLayer * inetLayer, ListenIterator Shutdown(); // ensure everything starts fresh size_t endpointIndex = 0; - chip::Inet::InterfaceId interfaceId = INET_NULL_INTERFACEID; + chip::Inet::InterfaceId interfaceId = chip::Inet::InterfaceId::Null(); chip::Inet::IPAddressType addressType; ShutdownOnError autoShutdown(this); @@ -176,8 +176,8 @@ CHIP_ERROR ServerBase::Listen(chip::Inet::InetLayer * inetLayer, ListenIterator CHIP_ERROR err = JoinMulticastGroup(interfaceId, info->udp, addressType); if (err != CHIP_NO_ERROR) { - char interfaceName[chip::Inet::InterfaceIterator::kMaxIfNameLength]; - chip::Inet::GetInterfaceName(interfaceId, interfaceName, sizeof(interfaceName)); + char interfaceName[chip::Inet::InterfaceId::kMaxIfNameLength]; + interfaceId.GetInterfaceName(interfaceName, sizeof(interfaceName)); // Log only as non-fatal error. Failure to join will mean we reply to unicast queries only. ChipLogError(DeviceLayer, "MDNS failed to join multicast group on %s for address type %s: %s", interfaceName, @@ -211,7 +211,7 @@ CHIP_ERROR ServerBase::DirectSend(chip::System::PacketBufferHandle && data, cons chip::Inet::InterfaceId boundIf = info->udp->GetBoundInterface(); - if ((boundIf != INET_NULL_INTERFACEID) && (boundIf != interface)) + if ((boundIf.IsPresent()) && (boundIf != interface)) { continue; } @@ -234,7 +234,7 @@ CHIP_ERROR ServerBase::BroadcastSend(chip::System::PacketBufferHandle && data, u continue; } - if ((info->interfaceId != interface) && (info->interfaceId != INET_NULL_INTERFACEID)) + if ((info->interfaceId != interface) && (info->interfaceId != chip::Inet::InterfaceId::Null())) { continue; } diff --git a/src/lib/dnssd/minimal_mdns/Server.h b/src/lib/dnssd/minimal_mdns/Server.h index b8ca2bc1d71849..3c5200d7b29799 100644 --- a/src/lib/dnssd/minimal_mdns/Server.h +++ b/src/lib/dnssd/minimal_mdns/Server.h @@ -44,7 +44,7 @@ void GetIpv4Into(chip::Inet::IPAddress & dest); /// interface matters (e.g. FF02::FB will care over which IPv6 interface it is sent) /// /// For MDNS in particular, you may want: -/// - IPv4 listen on INET_NULL_INTERFACEID +/// - IPv4 listen on InterfaceId::Null() /// - IPv6 listen on every specific interface id available (except local loopback and other /// not usable interfaces like docker) class ListenIterator @@ -77,7 +77,7 @@ class ServerBase public: struct EndpointInfo { - chip::Inet::InterfaceId interfaceId = INET_NULL_INTERFACEID; + chip::Inet::InterfaceId interfaceId = chip::Inet::InterfaceId::Null(); chip::Inet::IPAddressType addressType; chip::Inet::UDPEndPoint * udp = nullptr; }; diff --git a/src/lib/dnssd/minimal_mdns/responders/QueryResponder.cpp b/src/lib/dnssd/minimal_mdns/responders/QueryResponder.cpp index 1db519e033b397..b2cf27c91726cb 100644 --- a/src/lib/dnssd/minimal_mdns/responders/QueryResponder.cpp +++ b/src/lib/dnssd/minimal_mdns/responders/QueryResponder.cpp @@ -160,7 +160,7 @@ void QueryResponderBase::ClearBroadcastThrottle() { for (size_t i = 0; i < mResponderInfoSize; i++) { - mResponderInfos[i].lastMulticastTime = 0; + mResponderInfos[i].lastMulticastTime = chip::System::Clock::Zero; } } diff --git a/src/lib/dnssd/minimal_mdns/responders/QueryResponder.h b/src/lib/dnssd/minimal_mdns/responders/QueryResponder.h index d84f9da035dd85..efbf54e9bd6cc0 100644 --- a/src/lib/dnssd/minimal_mdns/responders/QueryResponder.h +++ b/src/lib/dnssd/minimal_mdns/responders/QueryResponder.h @@ -29,9 +29,9 @@ namespace Minimal { /// Represents available data (replies) for mDNS queries. struct QueryResponderRecord { - Responder * responder = nullptr; // what response/data is available - bool reportService = false; // report as a service when listing dnssd services - uint64_t lastMulticastTime = 0; // last time this record was multicast + Responder * responder = nullptr; // what response/data is available + bool reportService = false; // report as a service when listing dnssd services + chip::System::Clock::Timestamp lastMulticastTime{ 0 }; // last time this record was multicast }; namespace Internal { @@ -122,9 +122,9 @@ class QueryResponderRecordFilter /// Filter out anything that was multicast past ms. /// If ms is 0, no filtering is done - QueryResponderRecordFilter & SetIncludeOnlyMulticastBeforeMS(uint64_t ms) + QueryResponderRecordFilter & SetIncludeOnlyMulticastBeforeMS(chip::System::Clock::Timestamp time) { - mIncludeOnlyMulticastBeforeMS = ms; + mIncludeOnlyMulticastBefore = time; return *this; } @@ -140,7 +140,7 @@ class QueryResponderRecordFilter return false; } - if ((mIncludeOnlyMulticastBeforeMS > 0) && (record->lastMulticastTime >= mIncludeOnlyMulticastBeforeMS)) + if ((mIncludeOnlyMulticastBefore > chip::System::Clock::Zero) && (record->lastMulticastTime >= mIncludeOnlyMulticastBefore)) { return false; } @@ -154,9 +154,9 @@ class QueryResponderRecordFilter } private: - bool mIncludeAdditionalRepliesOnly = false; - ReplyFilter * mReplyFilter = nullptr; - uint64_t mIncludeOnlyMulticastBeforeMS = 0; + bool mIncludeAdditionalRepliesOnly = false; + ReplyFilter * mReplyFilter = nullptr; + chip::System::Clock::Timestamp mIncludeOnlyMulticastBefore{ 0 }; }; /// Iterates over an array of QueryResponderRecord items, providing only 'valid' ones, where diff --git a/src/lib/dnssd/minimal_mdns/responders/tests/TestIPResponder.cpp b/src/lib/dnssd/minimal_mdns/responders/tests/TestIPResponder.cpp index 4ed00d610e43f1..7cafa4344b578c 100644 --- a/src/lib/dnssd/minimal_mdns/responders/tests/TestIPResponder.cpp +++ b/src/lib/dnssd/minimal_mdns/responders/tests/TestIPResponder.cpp @@ -57,7 +57,7 @@ InterfaceId FindValidInterfaceId() return it.GetInterfaceId(); } } - return INET_NULL_INTERFACEID; + return InterfaceId::Null(); } #if INET_CONFIG_ENABLE_IPV4 diff --git a/src/lib/dnssd/minimal_mdns/responders/tests/TestPtrResponder.cpp b/src/lib/dnssd/minimal_mdns/responders/tests/TestPtrResponder.cpp index be2135ce4a8680..f0cdd7fd79d37a 100644 --- a/src/lib/dnssd/minimal_mdns/responders/tests/TestPtrResponder.cpp +++ b/src/lib/dnssd/minimal_mdns/responders/tests/TestPtrResponder.cpp @@ -99,7 +99,7 @@ void TestPtrResponse(nlTestSuite * inSuite, void * inContext) packetInfo.DestAddress = ipAddress; packetInfo.SrcPort = kMdnsPort; packetInfo.DestPort = kMdnsPort; - packetInfo.Interface = INET_NULL_INTERFACEID; + packetInfo.Interface = InterfaceId::Null(); responder.AddAllResponses(&packetInfo, &acc); } diff --git a/src/lib/dnssd/minimal_mdns/tests/TestActiveResolveAttempts.cpp b/src/lib/dnssd/minimal_mdns/tests/TestActiveResolveAttempts.cpp index d100ce8b6c2208..ea202c89d0bac0 100644 --- a/src/lib/dnssd/minimal_mdns/tests/TestActiveResolveAttempts.cpp +++ b/src/lib/dnssd/minimal_mdns/tests/TestActiveResolveAttempts.cpp @@ -23,21 +23,19 @@ namespace { using namespace chip; +using namespace chip::System::Clock::Literals; +using chip::System::Clock::Timeout; class MockClock : public System::Clock::ClockBase { public: - System::Clock::Microseconds64 GetMonotonicMicroseconds64() override { return mUsec; } - System::Clock::Milliseconds64 GetMonotonicMilliseconds64() override - { - return std::chrono::duration_cast(mUsec); - } + System::Clock::Microseconds64 GetMonotonicMicroseconds64() override { return mMsec; } + System::Clock::Milliseconds64 GetMonotonicMilliseconds64() override { return mMsec; } - void AdvanceMs(uint32_t ms) { mUsec += System::Clock::Milliseconds32(ms); } - void AdvanceSec(uint32_t s) { mUsec += System::Clock::Seconds32(s); } + void Advance(System::Clock::Milliseconds32 ms) { mMsec += ms; } private: - System::Clock::Microseconds64 mUsec; + System::Clock::Milliseconds64 mMsec; }; PeerId MakePeerId(NodeId nodeId) @@ -51,41 +49,41 @@ void TestSinglePeerAddRemove(nlTestSuite * inSuite, void * inContext) MockClock mockClock; mdns::Minimal::ActiveResolveAttempts attempts(&mockClock); - mockClock.AdvanceMs(1234); + mockClock.Advance(1234_ms32); // Starting up, no scheduled peers are expected - NL_TEST_ASSERT(inSuite, !attempts.GetMsUntilNextExpectedResponse().HasValue()); + NL_TEST_ASSERT(inSuite, !attempts.GetTimeUntilNextExpectedResponse().HasValue()); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); // Adding a single peer should result in it being scheduled attempts.MarkPending(MakePeerId(1)); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(0u)); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(0_ms32)); NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(1))); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); // one Next schedule is called, expect to have a delay of 1000 ms - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(1000u)); - mockClock.AdvanceMs(500); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(500u)); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(1000_ms32)); + mockClock.Advance(500_ms32); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(500_ms32)); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); // past due date: timeout should be 0 - mockClock.AdvanceMs(800); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(0u)); + mockClock.Advance(800_ms32); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(0_ms32)); NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(1))); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); // one Next schedule is called, expect to have a delay of 2000 ms // sincve the timeout doubles every time - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(2000u)); - mockClock.AdvanceMs(100); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(1900u)); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(2000_ms32)); + mockClock.Advance(100_ms32); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(1900_ms32)); // once complete, nothing to schedule attempts.Complete(MakePeerId(1)); - NL_TEST_ASSERT(inSuite, !attempts.GetMsUntilNextExpectedResponse().HasValue()); + NL_TEST_ASSERT(inSuite, !attempts.GetTimeUntilNextExpectedResponse().HasValue()); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); } @@ -94,31 +92,31 @@ void TestRescheduleSamePeerId(nlTestSuite * inSuite, void * inContext) MockClock mockClock; mdns::Minimal::ActiveResolveAttempts attempts(&mockClock); - mockClock.AdvanceMs(112233); + mockClock.Advance(112233_ms32); attempts.MarkPending(MakePeerId(1)); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(0u)); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(0_ms32)); NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(1))); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); // one Next schedule is called, expect to have a delay of 1000 ms - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(1000u)); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(1000_ms32)); // 2nd try goes to 2 seconds (once at least 1 second passes) - mockClock.AdvanceMs(1234); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(0u)); + mockClock.Advance(1234_ms32); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(0_ms32)); NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(1))); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(2000u)); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(2000_ms32)); // reschedule starts fresh attempts.MarkPending(MakePeerId(1)); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(0u)); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(0_ms32)); NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(1))); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(1000u)); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(1000_ms32)); } void TestLRU(nlTestSuite * inSuite, void * inContext) @@ -127,18 +125,18 @@ void TestLRU(nlTestSuite * inSuite, void * inContext) MockClock mockClock; mdns::Minimal::ActiveResolveAttempts attempts(&mockClock); - mockClock.AdvanceMs(334455); + mockClock.Advance(334455_ms32); // add a single very old peer attempts.MarkPending(MakePeerId(9999)); NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(9999))); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); - mockClock.AdvanceMs(1000); + mockClock.Advance(1000_ms32); NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(9999))); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); - mockClock.AdvanceMs(2000); + mockClock.Advance(2000_ms32); NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(9999))); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); @@ -147,21 +145,21 @@ void TestLRU(nlTestSuite * inSuite, void * inContext) for (uint32_t i = 1; i < mdns::Minimal::ActiveResolveAttempts::kRetryQueueSize; i++) { attempts.MarkPending(MakePeerId(i)); - mockClock.AdvanceMs(1); + mockClock.Advance(1_ms32); NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(i))); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); } // +2 because: 1 element skipped, one element is the "current" that has a delay of 1000ms - NL_TEST_ASSERT( - inSuite, - attempts.GetMsUntilNextExpectedResponse() == - Optional::Value(static_cast(1000 - mdns::Minimal::ActiveResolveAttempts::kRetryQueueSize + 2))); + NL_TEST_ASSERT(inSuite, + attempts.GetTimeUntilNextExpectedResponse() == + Optional::Value( + System::Clock::Milliseconds32(1000 - mdns::Minimal::ActiveResolveAttempts::kRetryQueueSize + 2))); // add another element - this should overwrite peer 9999 attempts.MarkPending(MakePeerId(mdns::Minimal::ActiveResolveAttempts::kRetryQueueSize)); - mockClock.AdvanceSec(32); + mockClock.Advance(32_s16); for (Optional peerId = attempts.NextScheduledPeer(); peerId.HasValue(); peerId = attempts.NextScheduledPeer()) { @@ -169,7 +167,7 @@ void TestLRU(nlTestSuite * inSuite, void * inContext) } // Still have active pending items (queue is full) - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse().HasValue()); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse().HasValue()); // expire all of them. Since we double timeout every expiry, we expect a // few iteratios to be able to expire the entire queue @@ -178,13 +176,13 @@ void TestLRU(nlTestSuite * inSuite, void * inContext) int i = 0; for (; i < kMaxIterations; i++) { - Optional ms = attempts.GetMsUntilNextExpectedResponse(); + Optional ms = attempts.GetTimeUntilNextExpectedResponse(); if (!ms.HasValue()) { break; } - mockClock.AdvanceMs(ms.Value()); + mockClock.Advance(ms.Value()); Optional peerId = attempts.NextScheduledPeer(); while (peerId.HasValue()) @@ -201,16 +199,16 @@ void TestNextPeerOrdering(nlTestSuite * inSuite, void * inContext) MockClock mockClock; mdns::Minimal::ActiveResolveAttempts attempts(&mockClock); - mockClock.AdvanceMs(123321); + mockClock.Advance(123321_ms32); // add a single peer that will be resolved quickly attempts.MarkPending(MakePeerId(1)); NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(1))); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(1000u)); - mockClock.AdvanceMs(20); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(980u)); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(1000_ms32)); + mockClock.Advance(20_ms32); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(980_ms32)); // expect peerid to be resolve within 1 second from now attempts.MarkPending(MakePeerId(2)); @@ -218,14 +216,14 @@ void TestNextPeerOrdering(nlTestSuite * inSuite, void * inContext) // mock that we are querying 2 as well NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(2))); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); - mockClock.AdvanceMs(80); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(900u)); + mockClock.Advance(80_ms32); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(900_ms32)); // Peer 1 is done, now peer2 should be pending (in 980ms) attempts.Complete(MakePeerId(1)); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(920u)); - mockClock.AdvanceMs(20); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(900u)); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(920_ms32)); + mockClock.Advance(20_ms32); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(900_ms32)); // Once peer 3 is added, queue should be // - 900 ms until peer id 2 is pending @@ -233,19 +231,19 @@ void TestNextPeerOrdering(nlTestSuite * inSuite, void * inContext) attempts.MarkPending(MakePeerId(3)); NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(3))); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(900u)); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(900_ms32)); // After the clock advance // - 400 ms until peer id 2 is pending // - 500 ms until peer id 3 is pending - mockClock.AdvanceMs(500); + mockClock.Advance(500_ms32); - NL_TEST_ASSERT(inSuite, attempts.GetMsUntilNextExpectedResponse() == Optional::Value(400u)); + NL_TEST_ASSERT(inSuite, attempts.GetTimeUntilNextExpectedResponse() == Optional(400_ms32)); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); // advancing the clock 'too long' will return both other entries, in reverse order due to how // the internal cache is built - mockClock.AdvanceMs(500); + mockClock.Advance(500_ms32); NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(3))); NL_TEST_ASSERT(inSuite, attempts.NextScheduledPeer() == Optional::Value(MakePeerId(2))); NL_TEST_ASSERT(inSuite, !attempts.NextScheduledPeer().HasValue()); diff --git a/src/lib/dnssd/tests/TestDnssdCache.cpp b/src/lib/dnssd/tests/TestDnssdCache.cpp index d24a1e9f03e276..aaddc91d767c12 100644 --- a/src/lib/dnssd/tests/TestDnssdCache.cpp +++ b/src/lib/dnssd/tests/TestDnssdCache.cpp @@ -51,7 +51,7 @@ void TestInsert(nlTestSuite * inSuite, void * inContext) PeerId peerId; int64_t id = 0x100; uint16_t port = 2000; - constexpr Inet::InterfaceId iface = INET_NULL_INTERFACEID; + constexpr Inet::InterfaceId iface = Inet::InterfaceId::Null(); Inet::IPAddress addr; Inet::IPAddress addrV6; diff --git a/src/lib/support/CHIPArgParser.cpp b/src/lib/support/CHIPArgParser.cpp index 2f0d0d74bb4acc..7618bcdcdfae87 100644 --- a/src/lib/support/CHIPArgParser.cpp +++ b/src/lib/support/CHIPArgParser.cpp @@ -753,6 +753,64 @@ bool ParseInt(const char * str, int32_t & output, int base) return parseEnd > str && *parseEnd == 0 && ((v != LONG_MIN && v != LONG_MAX) || errno == 0); } +/** + * Parse and attempt to convert a string to a 16-bit unsigned integer, + * applying the appropriate interpretation based on the base parameter. + * + * @param[in] str A pointer to a NULL-terminated C string representing + * the integer to parse. + * @param[out] output A reference to storage for a 16-bit unsigned integer + * to which the parsed value will be stored on success. + * @param[in] base The base according to which the string should be + * interpreted and parsed. If 0 or 16, the string may + * be hexadecimal and prefixed with "0x". Otherwise, a 0 + * is implied as 10 unless a leading 0 is encountered in + * which 8 is implied. + * + * @return true on success; otherwise, false on failure. + */ +bool ParseInt(const char * str, uint16_t & output, int base) +{ + uint32_t v; + + if (!ParseInt(str, v, base) || !CanCastTo(v)) + { + return false; + } + output = static_cast(v); + + return true; +} + +/** + * Parse and attempt to convert a string to a 8-bit unsigned integer, + * applying the appropriate interpretation based on the base parameter. + * + * @param[in] str A pointer to a NULL-terminated C string representing + * the integer to parse. + * @param[out] output A reference to storage for a 8-bit unsigned integer + * to which the parsed value will be stored on success. + * @param[in] base The base according to which the string should be + * interpreted and parsed. If 0 or 16, the string may + * be hexadecimal and prefixed with "0x". Otherwise, a 0 + * is implied as 10 unless a leading 0 is encountered in + * which 8 is implied. + * + * @return true on success; otherwise, false on failure. + */ +bool ParseInt(const char * str, uint8_t & output, int base) +{ + uint32_t v; + + if (!ParseInt(str, v, base) || !CanCastTo(v)) + { + return false; + } + output = static_cast(v); + + return true; +} + /** * Parse and attempt to convert a string interpreted as a decimal * value to a 64-bit unsigned integer, applying the appropriate diff --git a/src/lib/support/CHIPArgParser.hpp b/src/lib/support/CHIPArgParser.hpp index c87a0caec0a93f..daeab0be9e6729 100644 --- a/src/lib/support/CHIPArgParser.hpp +++ b/src/lib/support/CHIPArgParser.hpp @@ -123,6 +123,8 @@ bool ParseInt(const char * str, uint16_t & output); bool ParseInt(const char * str, int32_t & output); bool ParseInt(const char * str, uint32_t & output); bool ParseInt(const char * str, uint64_t & output); +bool ParseInt(const char * str, uint8_t & output, int base); +bool ParseInt(const char * str, uint16_t & output, int base); bool ParseInt(const char * str, int32_t & output, int base); bool ParseInt(const char * str, uint32_t & output, int base); bool ParseInt(const char * str, uint64_t & output, int base); diff --git a/src/messaging/ReliableMessageContext.cpp b/src/messaging/ReliableMessageContext.cpp index a4bdbd14e47d2e..e30447050e0fd4 100644 --- a/src/messaging/ReliableMessageContext.cpp +++ b/src/messaging/ReliableMessageContext.cpp @@ -257,7 +257,7 @@ CHIP_ERROR ReliableMessageContext::HandleNeedsAckInner(uint32_t messageCounter, SetPendingPeerAckMessageCounter(messageCounter); mNextAckTimeTick = static_cast( CHIP_CONFIG_RMP_DEFAULT_ACK_TIMEOUT_TICK + - GetReliableMessageMgr()->GetTickCounterFromTimeDelta(System::SystemClock().GetMonotonicMilliseconds())); + GetReliableMessageMgr()->GetTickCounterFromTimeDelta(System::SystemClock().GetMonotonicTimestamp())); return CHIP_NO_ERROR; } } diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp index 09056536d6e22e..6188cf025dafe2 100644 --- a/src/messaging/ReliableMessageMgr.cpp +++ b/src/messaging/ReliableMessageMgr.cpp @@ -58,8 +58,8 @@ ReliableMessageMgr::~ReliableMessageMgr() {} void ReliableMessageMgr::Init(chip::System::Layer * systemLayer, SessionManager * sessionManager) { mSystemLayer = systemLayer; - mTimeStampBase = System::SystemClock().GetMonotonicMilliseconds(); - mCurrentTimerExpiry = 0; + mTimeStampBase = System::SystemClock().GetMonotonicTimestamp(); + mCurrentTimerExpiry = System::Clock::Zero; } void ReliableMessageMgr::Shutdown() @@ -75,12 +75,12 @@ void ReliableMessageMgr::Shutdown() mSystemLayer = nullptr; } -uint64_t ReliableMessageMgr::GetTickCounterFromTimePeriod(uint64_t period) +uint64_t ReliableMessageMgr::GetTickCounterFromTimePeriod(System::Clock::Milliseconds64 period) { - return (period >> mTimerIntervalShift); + return (period.count() >> mTimerIntervalShift); } -uint64_t ReliableMessageMgr::GetTickCounterFromTimeDelta(uint64_t newTime) +uint64_t ReliableMessageMgr::GetTickCounterFromTimeDelta(System::Clock::Timestamp newTime) { return GetTickCounterFromTimePeriod(newTime - mTimeStampBase); } @@ -197,7 +197,7 @@ static void TickProceed(uint16_t & time, uint64_t ticks) void ReliableMessageMgr::ExpireTicks() { - uint64_t now = System::SystemClock().GetMonotonicMilliseconds(); + System::Clock::Timestamp now = System::SystemClock().GetMonotonicTimestamp(); // Number of full ticks elapsed since last timer processing. We always round down // to the previous tick. If we are between tick boundaries, the extra time since the @@ -231,10 +231,10 @@ void ReliableMessageMgr::ExpireTicks() }); // Re-Adjust the base time stamp to the most recent tick boundary - mTimeStampBase += (deltaTicks << mTimerIntervalShift); + mTimeStampBase += System::Clock::Milliseconds32(deltaTicks << mTimerIntervalShift); #if defined(RMP_TICKLESS_DEBUG) - ChipLogDetail(ExchangeManager, "ReliableMessageMgr::ExpireTicks mTimeStampBase to %" PRIu64, mTimeStampBase); + ChipLogDetail(ExchangeManager, "ReliableMessageMgr::ExpireTicks mTimeStampBase to %" PRIu64, mTimeStampBase.count()); #endif } @@ -278,9 +278,8 @@ CHIP_ERROR ReliableMessageMgr::AddToRetransTable(ReliableMessageContext * rc, Re void ReliableMessageMgr::StartRetransmision(RetransTableEntry * entry) { - entry->nextRetransTimeTick = - static_cast(entry->ec->GetInitialRetransmitTimeoutTick() + - GetTickCounterFromTimeDelta(System::SystemClock().GetMonotonicMilliseconds())); + entry->nextRetransTimeTick = static_cast(entry->ec->GetInitialRetransmitTimeoutTick() + + GetTickCounterFromTimeDelta(System::SystemClock().GetMonotonicTimestamp())); // Check if the timer needs to be started and start it. StartTimer(); @@ -437,7 +436,8 @@ void ReliableMessageMgr::StartTimer() if (foundWake) { // Set timer for next tick boundary - subtract the elapsed time from the current tick - System::Clock::MonotonicMilliseconds timerExpiry = (nextWakeTimeTick << mTimerIntervalShift) + mTimeStampBase; + System::Clock::Timestamp timerExpiry = + System::Clock::Milliseconds32(nextWakeTimeTick << mTimerIntervalShift) + mTimeStampBase; #if defined(RMP_TICKLESS_DEBUG) ChipLogDetail(ExchangeManager, "ReliableMessageMgr::StartTimer wake at %" PRIu64 " ms (%" PRIu64 " %" PRIu64 ")", @@ -447,14 +447,15 @@ void ReliableMessageMgr::StartTimer() { // If the tick boundary has expired in the past (delayed processing of event due to other system activity), // expire the timer immediately - uint64_t now = System::SystemClock().GetMonotonicMilliseconds(); - uint64_t timerArmValue = (timerExpiry > now) ? timerExpiry - now : 0; + System::Clock::Timestamp now = System::SystemClock().GetMonotonicTimestamp(); + System::Clock::Timeout timerArmValue = (timerExpiry > now) ? timerExpiry - now : System::Clock::Zero; #if defined(RMP_TICKLESS_DEBUG) - ChipLogDetail(ExchangeManager, "ReliableMessageMgr::StartTimer set timer for %" PRIu64, timerArmValue); + ChipLogDetail(ExchangeManager, "ReliableMessageMgr::StartTimer set timer for %" PRIu32 " ms", + System::Clock::Milliseconds32(timerArmValue).count()); #endif StopTimer(); - res = mSystemLayer->StartTimer(System::Clock::Milliseconds32(timerArmValue), Timeout, this); + res = mSystemLayer->StartTimer(timerArmValue, Timeout, this); VerifyOrDieWithMsg(res == CHIP_NO_ERROR, ExchangeManager, "Cannot start ReliableMessageMgr::Timeout %" CHIP_ERROR_FORMAT, res.Format()); diff --git a/src/messaging/ReliableMessageMgr.h b/src/messaging/ReliableMessageMgr.h index 5befa502b0b753..617007a2f81b45 100644 --- a/src/messaging/ReliableMessageMgr.h +++ b/src/messaging/ReliableMessageMgr.h @@ -83,7 +83,7 @@ class ReliableMessageMgr * * @return Tick count for the time period. */ - uint64_t GetTickCounterFromTimePeriod(uint64_t period); + uint64_t GetTickCounterFromTimePeriod(System::Clock::Milliseconds64 period); /** * Return a tick counter value between the given time and the stored time. @@ -92,7 +92,7 @@ class ReliableMessageMgr * * @return Tick count of the difference between the given time and the stored time. */ - uint64_t GetTickCounterFromTimeDelta(uint64_t newTime); + uint64_t GetTickCounterFromTimeDelta(System::Clock::Timestamp newTime); /** * Iterate through active exchange contexts and retrans table entries. If an @@ -230,9 +230,9 @@ class ReliableMessageMgr private: BitMapObjectPool & mContextPool; chip::System::Layer * mSystemLayer; - uint64_t mTimeStampBase; // ReliableMessageProtocol timer base value to add offsets to evaluate timeouts - System::Clock::MonotonicMilliseconds mCurrentTimerExpiry; // Tracks when the ReliableMessageProtocol timer will next expire - uint16_t mTimerIntervalShift; // ReliableMessageProtocol Timer tick period shift + System::Clock::Timestamp mTimeStampBase; // ReliableMessageProtocol timer base value to add offsets to evaluate timeouts + System::Clock::Timestamp mCurrentTimerExpiry; // Tracks when the ReliableMessageProtocol timer will next expire + uint16_t mTimerIntervalShift; // ReliableMessageProtocol Timer tick period shift /* Placeholder function to run a function for all exchanges */ template diff --git a/src/messaging/tests/MessagingContext.cpp b/src/messaging/tests/MessagingContext.cpp index 3f963bb8565fbd..f680c40586a0dc 100644 --- a/src/messaging/tests/MessagingContext.cpp +++ b/src/messaging/tests/MessagingContext.cpp @@ -23,7 +23,7 @@ namespace chip { namespace Test { -CHIP_ERROR MessagingContext::Init(nlTestSuite * suite, TransportMgrBase * transport, IOContext * ioContext) +CHIP_ERROR MessagingContext::Init(TransportMgrBase * transport, IOContext * ioContext) { VerifyOrReturnError(mInitialized == false, CHIP_ERROR_INTERNAL); mInitialized = true; diff --git a/src/messaging/tests/MessagingContext.h b/src/messaging/tests/MessagingContext.h index ad8a4fa103e92d..4c8e9755fb02b1 100644 --- a/src/messaging/tests/MessagingContext.h +++ b/src/messaging/tests/MessagingContext.h @@ -42,7 +42,7 @@ class MessagingContext ~MessagingContext() { VerifyOrDie(mInitialized == false); } /// Initialize the underlying layers and test suite pointer - CHIP_ERROR Init(nlTestSuite * suite, TransportMgrBase * transport, IOContext * io); + CHIP_ERROR Init(TransportMgrBase * transport, IOContext * io); // Shutdown all layers, finalize operations CHIP_ERROR Shutdown(); diff --git a/src/messaging/tests/TestExchangeMgr.cpp b/src/messaging/tests/TestExchangeMgr.cpp index a4137b4dbb75d2..c7a80b9a7a7466 100644 --- a/src/messaging/tests/TestExchangeMgr.cpp +++ b/src/messaging/tests/TestExchangeMgr.cpp @@ -254,11 +254,11 @@ int Initialize(void * aContext) { // Initialize System memory and resources VerifyOrReturnError(chip::Platform::MemoryInit() == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gIOContext.Init(&sSuite) == CHIP_NO_ERROR, FAILURE); + VerifyOrReturnError(gIOContext.Init() == CHIP_NO_ERROR, FAILURE); VerifyOrReturnError(gTransportMgr.Init("LOOPBACK") == CHIP_NO_ERROR, FAILURE); auto * ctx = static_cast(aContext); - VerifyOrReturnError(ctx->Init(&sSuite, &gTransportMgr, &gIOContext) == CHIP_NO_ERROR, FAILURE); + VerifyOrReturnError(ctx->Init(&gTransportMgr, &gIOContext) == CHIP_NO_ERROR, FAILURE); return SUCCESS; } diff --git a/src/messaging/tests/TestReliableMessageProtocol.cpp b/src/messaging/tests/TestReliableMessageProtocol.cpp index 6da3dca818555c..b11ba217793522 100644 --- a/src/messaging/tests/TestReliableMessageProtocol.cpp +++ b/src/messaging/tests/TestReliableMessageProtocol.cpp @@ -564,7 +564,7 @@ void CheckResendSessionEstablishmentMessageWithPeerExchange(nlTestSuite * inSuit // Making this static to reduce stack usage, as some platforms have limits on stack size. static TestContext ctx; - CHIP_ERROR err = ctx.Init(inSuite, &gTransportMgr, &gIOContext); + CHIP_ERROR err = ctx.Init(&gTransportMgr, &gIOContext); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); chip::System::PacketBufferHandle buffer = chip::MessagePacketBuffer::NewWithData(PAYLOAD, sizeof(PAYLOAD)); @@ -1443,11 +1443,11 @@ int Initialize(void * aContext) { // Initialize System memory and resources VerifyOrReturnError(chip::Platform::MemoryInit() == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gIOContext.Init(&sSuite) == CHIP_NO_ERROR, FAILURE); + VerifyOrReturnError(gIOContext.Init() == CHIP_NO_ERROR, FAILURE); VerifyOrReturnError(gTransportMgr.Init(&gLoopback) == CHIP_NO_ERROR, FAILURE); auto * ctx = static_cast(aContext); - VerifyOrReturnError(ctx->Init(&sSuite, &gTransportMgr, &gIOContext) == CHIP_NO_ERROR, FAILURE); + VerifyOrReturnError(ctx->Init(&gTransportMgr, &gIOContext) == CHIP_NO_ERROR, FAILURE); gTransportMgr.SetSessionManager(&ctx->GetSecureSessionManager()); return SUCCESS; diff --git a/src/messaging/tests/echo/echo_requester.cpp b/src/messaging/tests/echo/echo_requester.cpp index d2f87803bdb134..7e2486e9e46692 100644 --- a/src/messaging/tests/echo/echo_requester.cpp +++ b/src/messaging/tests/echo/echo_requester.cpp @@ -49,8 +49,8 @@ namespace { // Max value for the number of EchoRequests sent. constexpr size_t kMaxEchoCount = 3; -// The CHIP Echo interval time in milliseconds. -constexpr int32_t gEchoInterval = 1000; +// The CHIP Echo interval time. +constexpr chip::System::Clock::Timeout gEchoInterval = chip::System::Clock::Seconds16(1); constexpr chip::FabricIndex gFabricIndex = 0; @@ -62,7 +62,7 @@ chip::TransportMgr::Value( - chip::Transport::PeerAddress::UDP(gDestAddr, CHIP_PORT, INET_NULL_INTERFACEID)); + chip::Transport::PeerAddress::UDP(gDestAddr, CHIP_PORT, chip::Inet::InterfaceId::Null())); } // Attempt to connect to the peer. @@ -173,7 +173,7 @@ CHIP_ERROR EstablishSecureSession() if (err != CHIP_NO_ERROR) { printf("Establish secure session failed, err: %s\n", chip::ErrorStr(err)); - gLastEchoTime = chip::System::SystemClock().GetMonotonicMilliseconds(); + gLastEchoTime = chip::System::SystemClock().GetMonotonicTimestamp(); } else { @@ -185,13 +185,14 @@ CHIP_ERROR EstablishSecureSession() void HandleEchoResponseReceived(chip::Messaging::ExchangeContext * ec, chip::System::PacketBufferHandle && payload) { - uint32_t respTime = chip::System::SystemClock().GetMonotonicMilliseconds(); - uint32_t transitTime = respTime - gLastEchoTime; + chip::System::Clock::Timestamp respTime = chip::System::SystemClock().GetMonotonicTimestamp(); + chip::System::Clock::Timeout transitTime = respTime - gLastEchoTime; gEchoRespCount++; - printf("Echo Response: %" PRIu64 "/%" PRIu64 "(%.2f%%) len=%u time=%.3fms\n", gEchoRespCount, gEchoCount, - static_cast(gEchoRespCount) * 100 / gEchoCount, payload->DataLength(), static_cast(transitTime) / 1000); + printf("Echo Response: %" PRIu64 "/%" PRIu64 "(%.2f%%) len=%u time=%.3fs\n", gEchoRespCount, gEchoCount, + static_cast(gEchoRespCount) * 100 / gEchoCount, payload->DataLength(), + static_cast(chip::System::Clock::Milliseconds32(transitTime).count()) / 1000); } } // namespace diff --git a/src/platform/Darwin/DnssdImpl.cpp b/src/platform/Darwin/DnssdImpl.cpp index c9e1857f4ecb39..60545753041f32 100644 --- a/src/platform/Darwin/DnssdImpl.cpp +++ b/src/platform/Darwin/DnssdImpl.cpp @@ -45,7 +45,7 @@ bool IsSupportedProtocol(DnssdServiceProtocol protocol) uint32_t GetInterfaceId(chip::Inet::InterfaceId interfaceId) { - return (interfaceId == INET_NULL_INTERFACEID) ? kDNSServiceInterfaceIndexAny : interfaceId; + return interfaceId.IsPresent() ? interfaceId.GetPlatformInterface() : kDNSServiceInterfaceIndexAny; } std::string GetFullType(const char * type, DnssdServiceProtocol protocol) @@ -304,10 +304,11 @@ CHIP_ERROR Register(uint32_t interfaceId, const char * type, const char * name, return MdnsContexts::GetInstance().Add(sdCtx, sdRef); } -void OnBrowseAdd(BrowseContext * context, const char * name, const char * type, const char * domain, uint32_t interfaceId) +void OnBrowseAdd(BrowseContext * context, const char * name, const char * type, const char * domain, + chip::Inet::InterfaceId interfaceId) { ChipLogDetail(DeviceLayer, "Mdns: %s name: %s, type: %s, domain: %s, interface: %d", __func__, name, type, domain, - interfaceId); + interfaceId.GetPlatformInterface()); VerifyOrReturn(strcmp(kLocalDot, domain) == 0); @@ -328,10 +329,11 @@ void OnBrowseAdd(BrowseContext * context, const char * name, const char * type, context->services.push_back(service); } -void OnBrowseRemove(BrowseContext * context, const char * name, const char * type, const char * domain, uint32_t interfaceId) +void OnBrowseRemove(BrowseContext * context, const char * name, const char * type, const char * domain, + chip::Inet::InterfaceId interfaceId) { ChipLogDetail(DeviceLayer, "Mdns: %s name: %s, type: %s, domain: %s, interface: %d", __func__, name, type, domain, - interfaceId); + interfaceId.GetPlatformInterface()); VerifyOrReturn(strcmp(kLocalDot, domain) == 0); @@ -347,8 +349,8 @@ static void OnBrowse(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interf BrowseContext * sdCtx = reinterpret_cast(context); VerifyOrReturn(CheckForSuccess(sdCtx, __func__, err, true)); - (flags & kDNSServiceFlagsAdd) ? OnBrowseAdd(sdCtx, name, type, domain, interfaceId) - : OnBrowseRemove(sdCtx, name, type, domain, interfaceId); + (flags & kDNSServiceFlagsAdd) ? OnBrowseAdd(sdCtx, name, type, domain, Inet::InterfaceId(interfaceId)) + : OnBrowseRemove(sdCtx, name, type, domain, Inet::InterfaceId(interfaceId)); if (!(flags & kDNSServiceFlagsMoreComing)) { @@ -397,7 +399,7 @@ static void OnGetAddrInfo(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t i service.mAddress.SetValue(chip::Inet::IPAddress::FromSockAddr(*address)); Platform::CopyString(service.mName, sdCtx->name); Platform::CopyString(service.mHostName, hostname); - service.mInterface = sdCtx->interfaceId; + service.mInterface = Inet::InterfaceId(sdCtx->interfaceId); sdCtx->callback(sdCtx->context, &service, CHIP_NO_ERROR); MdnsContexts::GetInstance().Remove(sdCtx); diff --git a/src/platform/ESP32/ConnectivityManagerImpl.h b/src/platform/ESP32/ConnectivityManagerImpl.h index e39c3b61445d71..efa0b6b6c331b6 100644 --- a/src/platform/ESP32/ConnectivityManagerImpl.h +++ b/src/platform/ESP32/ConnectivityManagerImpl.h @@ -46,11 +46,12 @@ #include "esp_event.h" +namespace chip { + namespace Inet { class IPAddress; } // namespace Inet -namespace chip { namespace DeviceLayer { class PlatformManagerImpl; diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp index eba6b1c6e81a32..27ba37d5411692 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl.cpp @@ -967,7 +967,7 @@ CHIP_ERROR ConnectivityManagerImpl::ProvisionWiFiNetwork(const char * ssid, cons // This should be removed or find a better place once we depercate the rendezvous session. for (chip::Inet::InterfaceAddressIterator it; it.HasCurrent(); it.Next()) { - char ifName[chip::Inet::InterfaceIterator::kMaxIfNameLength]; + char ifName[chip::Inet::InterfaceId::kMaxIfNameLength]; if (it.IsUp() && CHIP_NO_ERROR == it.GetInterfaceName(ifName, sizeof(ifName)) && strncmp(ifName, sWiFiIfName, sizeof(ifName)) == 0) { @@ -1068,8 +1068,8 @@ CHIP_ERROR ConnectivityManagerImpl::_GetNetworkInterfaces(NetworkInterface ** ne { NetworkInterface * ifp = new NetworkInterface(); - strncpy(ifp->Name, ifa->ifa_name, Inet::InterfaceIterator::kMaxIfNameLength); - ifp->Name[Inet::InterfaceIterator::kMaxIfNameLength - 1] = '\0'; + strncpy(ifp->Name, ifa->ifa_name, Inet::InterfaceId::kMaxIfNameLength); + ifp->Name[Inet::InterfaceId::kMaxIfNameLength - 1] = '\0'; ifp->name = CharSpan(ifp->Name, strlen(ifp->Name)); ifp->fabricConnected = ifa->ifa_flags & IFF_RUNNING; diff --git a/src/platform/Linux/DnssdImpl.cpp b/src/platform/Linux/DnssdImpl.cpp index 4452ee78293040..b1d8589843f6c7 100644 --- a/src/platform/Linux/DnssdImpl.cpp +++ b/src/platform/Linux/DnssdImpl.cpp @@ -461,7 +461,7 @@ CHIP_ERROR MdnsAvahi::PublishService(const DnssdService & service) CHIP_ERROR error = CHIP_NO_ERROR; AvahiStringList * text = nullptr; AvahiIfIndex interface = - service.mInterface == INET_NULL_INTERFACEID ? AVAHI_IF_UNSPEC : static_cast(service.mInterface); + service.mInterface.IsPresent() ? static_cast(service.mInterface.GetPlatformInterface()) : AVAHI_IF_UNSPEC; keyBuilder << service.mName << "." << type << service.mPort << "." << interface; key = keyBuilder.str(); @@ -530,12 +530,12 @@ CHIP_ERROR MdnsAvahi::Browse(const char * type, DnssdServiceProtocol protocol, c { AvahiServiceBrowser * browser; BrowseContext * browseContext = chip::Platform::New(); - AvahiIfIndex avahiInterface = static_cast(interface); + AvahiIfIndex avahiInterface = static_cast(interface.GetPlatformInterface()); browseContext->mInstance = this; browseContext->mContext = context; browseContext->mCallback = callback; - if (interface == INET_NULL_INTERFACEID) + if (!interface.IsPresent()) { avahiInterface = AVAHI_IF_UNSPEC; } @@ -615,7 +615,7 @@ void MdnsAvahi::HandleBrowse(AvahiServiceBrowser * browser, AvahiIfIndex interfa CopyTypeWithoutProtocol(service.mType, type); service.mProtocol = GetProtocolInType(type); service.mAddressType = ToAddressType(protocol); - service.mInterface = INET_NULL_INTERFACEID; + service.mInterface = Inet::InterfaceId::Null(); if (interface != AVAHI_IF_UNSPEC) { service.mInterface = static_cast(interface); @@ -650,14 +650,14 @@ CHIP_ERROR MdnsAvahi::Resolve(const char * name, const char * type, DnssdService DnssdResolveCallback callback, void * context) { AvahiServiceResolver * resolver; - AvahiIfIndex avahiInterface = static_cast(interface); + AvahiIfIndex avahiInterface = static_cast(interface.GetPlatformInterface()); ResolveContext * resolveContext = chip::Platform::New(); CHIP_ERROR error = CHIP_NO_ERROR; resolveContext->mInstance = this; resolveContext->mCallback = callback; resolveContext->mContext = context; - if (interface == INET_NULL_INTERFACEID) + if (!interface.IsPresent()) { avahiInterface = AVAHI_IF_UNSPEC; } @@ -700,7 +700,7 @@ void MdnsAvahi::HandleResolve(AvahiServiceResolver * resolver, AvahiIfIndex inte result.mProtocol = GetProtocolInType(type); result.mPort = port; result.mAddressType = ToAddressType(protocol); - result.mInterface = INET_NULL_INTERFACEID; + result.mInterface = Inet::InterfaceId::Null(); if (interface != AVAHI_IF_UNSPEC) { result.mInterface = static_cast(interface); diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp index ff0d80f83917d1..ecb045460dc754 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp @@ -1918,7 +1918,7 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::FromOtDnsRespons mdnsService.mProtocol = chip::Dnssd::DnssdServiceProtocol::kDnssdProtocolUnknown; } mdnsService.mPort = serviceInfo.mPort; - mdnsService.mInterface = INET_NULL_INTERFACEID; + mdnsService.mInterface = Inet::InterfaceId::Null(); mdnsService.mAddressType = Inet::IPAddressType::kIPv6; mdnsService.mAddress = chip::Optional(ToIPAddress(serviceInfo.mHostAddress)); diff --git a/src/platform/P6/BLEManagerImpl.cpp b/src/platform/P6/BLEManagerImpl.cpp index 5d28ec216217f8..69620b24543e65 100644 --- a/src/platform/P6/BLEManagerImpl.cpp +++ b/src/platform/P6/BLEManagerImpl.cpp @@ -254,8 +254,8 @@ void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) PacketBufferHandle::Adopt(event->CHIPoBLEWriteReceived.Data)); break; - case DeviceEventType::kCHIPoBLEIndicateConfirm: - HandleIndicationConfirmation(event->CHIPoBLEIndicateConfirm.ConId, &CHIP_BLE_SVC_ID, &ChipUUID_CHIPoBLEChar_TX); + case DeviceEventType::kCHIPoBLENotifyConfirm: + HandleIndicationConfirmation(event->CHIPoBLENotifyConfirm.ConId, &CHIP_BLE_SVC_ID, &ChipUUID_CHIPoBLEChar_TX); break; case DeviceEventType::kCHIPoBLEConnectionError: @@ -342,18 +342,26 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU VerifyOrExit(conState != NULL, err = CHIP_ERROR_INVALID_ARGUMENT); #ifdef BLE_DEBUG - ChipLogDetail(DeviceLayer, "Sending indication for CHIPoBLE TX characteristic (con %u, len %u)", conId, dataLen); + ChipLogDetail(DeviceLayer, "Sending notification for CHIPoBLE TX characteristic (con %u, len %u)", conId, dataLen); #endif - // Send a indication for the CHIPoBLE TX characteristic to the client containing the supplied data. - gatt_err = wiced_bt_gatt_send_indication((uint16_t) conId, HDLC_CHIP_SERVICE_CHAR_C2_VALUE, dataLen, data->Start()); + // Send a notification for the CHIPoBLE TX characteristic to the client containing the supplied data. + gatt_err = wiced_bt_gatt_send_notification((uint16_t) conId, HDLC_CHIP_SERVICE_CHAR_C2_VALUE, dataLen, data->Start()); exit: if (gatt_err != WICED_BT_GATT_SUCCESS) { - ChipLogError(DeviceLayer, "BLEManagerImpl::SendIndication() failed: %ld", gatt_err); + ChipLogError(DeviceLayer, "BLEManagerImpl::SendNotification() failed: %ld", gatt_err); return false; } + else + { + // Post an event to the CHIP queue. + ChipDeviceEvent event; + event.Type = DeviceEventType::kCHIPoBLENotifyConfirm; + event.CHIPoBLENotifyConfirm.ConId = conId; + err = PlatformMgr().PostEvent(&event); + } return err == CHIP_NO_ERROR; } @@ -615,27 +623,6 @@ wiced_bt_gatt_status_t BLEManagerImpl::HandleGattServiceMtuReq(wiced_bt_gatt_att return WICED_BT_GATT_SUCCESS; } -/* - * Process GATT Indication Confirm from the client - */ -wiced_bt_gatt_status_t BLEManagerImpl::HandleGattServiceIndCfm(uint16_t conn_id, uint16_t handle) -{ -#ifdef BLE_DEBUG - ChipLogDetail(DeviceLayer, "GATT Ind Cfm received con:%04x handle:%d", conn_id, handle); -#endif - if (handle == HDLC_CHIP_SERVICE_CHAR_C2_VALUE) - { - ChipDeviceEvent event; - event.Type = DeviceEventType::kCHIPoBLEIndicateConfirm; - event.CHIPoBLEIndicateConfirm.ConId = conn_id; - if (PlatformMgr().PostEvent(&event) != CHIP_NO_ERROR) - { - return WICED_BT_GATT_INTERNAL_ERROR; - } - } - return WICED_BT_GATT_SUCCESS; -} - /* * Process GATT attribute requests */ @@ -658,10 +645,6 @@ wiced_bt_gatt_status_t BLEManagerImpl::HandleGattServiceRequestEvent(wiced_bt_ga result = HandleGattServiceMtuReq(p_request, p_conn); break; - case GATTS_REQ_TYPE_CONF: - result = HandleGattServiceIndCfm(p_request->conn_id, p_request->data.handle); - break; - default: break; } diff --git a/src/platform/android/DnssdImpl.cpp b/src/platform/android/DnssdImpl.cpp index 27f3fa26203ed8..8d5b5c4e2c81d2 100644 --- a/src/platform/android/DnssdImpl.cpp +++ b/src/platform/android/DnssdImpl.cpp @@ -17,6 +17,7 @@ #include "DnssdImpl.h" +#include #include #include #include @@ -36,9 +37,11 @@ namespace Dnssd { using namespace chip::Platform; namespace { -jobject sResolverObject = nullptr; -jobject sMdnsCallbackObject = nullptr; -jmethodID sResolveMethod = nullptr; +jobject sResolverObject = nullptr; +jobject sMdnsCallbackObject = nullptr; +jmethodID sResolveMethod = nullptr; +jmethodID sPublishMethod = nullptr; +jmethodID sRemoveServicesMethod = nullptr; } // namespace // Implemention of functions declared in lib/dnssd/platform/Dnssd.h @@ -59,17 +62,75 @@ CHIP_ERROR ChipDnssdShutdown() CHIP_ERROR ChipDnssdRemoveServices() { - return CHIP_ERROR_NOT_IMPLEMENTED; + VerifyOrReturnError(sResolverObject != nullptr && sRemoveServicesMethod != nullptr, CHIP_ERROR_INCORRECT_STATE); + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + + env->CallVoidMethod(sResolverObject, sRemoveServicesMethod); + + if (env->ExceptionCheck()) + { + ChipLogError(Discovery, "Java exception in ChipDnssdRemoveServices"); + env->ExceptionDescribe(); + env->ExceptionClear(); + return CHIP_JNI_ERROR_EXCEPTION_THROWN; + } + + return CHIP_NO_ERROR; } CHIP_ERROR ChipDnssdPublishService(const DnssdService * service) { - return CHIP_ERROR_NOT_IMPLEMENTED; + VerifyOrReturnError(service != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(sResolverObject != nullptr && sPublishMethod != nullptr, CHIP_ERROR_INCORRECT_STATE); + + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + UtfString jniName(env, service->mName); + UtfString jniHostName(env, service->mHostName); + + std::string serviceType = service->mType; + serviceType += '.'; + serviceType += (service->mProtocol == DnssdServiceProtocol::kDnssdProtocolUdp ? "_udp" : "_tcp"); + UtfString jniServiceType(env, serviceType.c_str()); + + jclass stringClass = env->FindClass("java/lang/String"); + jobjectArray keys = env->NewObjectArray(service->mTextEntrySize, stringClass, nullptr); + + jclass arrayElemType = env->FindClass("[B"); + jobjectArray datas = env->NewObjectArray(service->mTextEntrySize, arrayElemType, nullptr); + + for (size_t i = 0; i < service->mTextEntrySize; i++) + { + UtfString jniKey(env, service->mTextEntries[i].mKey); + env->SetObjectArrayElement(keys, i, jniKey.jniValue()); + + ByteArray jniData(env, (const jbyte *) service->mTextEntries[i].mData, service->mTextEntries[i].mDataSize); + env->SetObjectArrayElement(datas, i, jniData.jniValue()); + } + + jobjectArray subTypes = env->NewObjectArray(service->mSubTypeSize, stringClass, nullptr); + for (size_t i = 0; i < service->mSubTypeSize; i++) + { + UtfString jniSubType(env, service->mSubTypes[i]); + env->SetObjectArrayElement(subTypes, i, jniSubType.jniValue()); + } + + env->CallVoidMethod(sResolverObject, sPublishMethod, jniName.jniValue(), jniHostName.jniValue(), jniServiceType.jniValue(), + service->mPort, keys, datas, subTypes); + + if (env->ExceptionCheck()) + { + ChipLogError(Discovery, "Java exception in ChipDnssdPublishService"); + env->ExceptionDescribe(); + env->ExceptionClear(); + return CHIP_JNI_ERROR_EXCEPTION_THROWN; + } + + return CHIP_NO_ERROR; } CHIP_ERROR ChipDnssdFinalizeServiceUpdate() { - return CHIP_ERROR_NOT_IMPLEMENTED; + return CHIP_NO_ERROR; } CHIP_ERROR ChipDnssdBrowse(const char * type, DnssdServiceProtocol protocol, Inet::IPAddressType addressType, @@ -120,12 +181,27 @@ void InitializeWithObjects(jobject resolverObject, jobject mdnsCallbackObject) sResolveMethod = env->GetMethodID(resolverClass, "resolve", "(Ljava/lang/String;Ljava/lang/String;JJLchip/platform/ChipMdnsCallback;)V"); - if (sResolveMethod == nullptr) { ChipLogError(Discovery, "Failed to access Resolver 'resolve' method"); env->ExceptionClear(); } + + sPublishMethod = + env->GetMethodID(resolverClass, "publish", + "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I[Ljava/lang/String;[[B[Ljava/lang/String;)V"); + if (sPublishMethod == nullptr) + { + ChipLogError(Discovery, "Failed to access Resolver 'publish' method"); + env->ExceptionClear(); + } + + sRemoveServicesMethod = env->GetMethodID(resolverClass, "removeServices", "()V"); + if (sRemoveServicesMethod == nullptr) + { + ChipLogError(Discovery, "Failed to access Resolver 'removeServices' method"); + env->ExceptionClear(); + } } void HandleResolve(jstring instanceName, jstring serviceType, jstring address, jint port, jlong callbackHandle, jlong contextHandle) diff --git a/src/platform/android/java/chip/platform/NsdManagerServiceResolver.java b/src/platform/android/java/chip/platform/NsdManagerServiceResolver.java index 76adab3cb3915b..b08686580fac02 100644 --- a/src/platform/android/java/chip/platform/NsdManagerServiceResolver.java +++ b/src/platform/android/java/chip/platform/NsdManagerServiceResolver.java @@ -25,6 +25,8 @@ import android.os.Handler; import android.os.Looper; import android.util.Log; +import java.util.ArrayList; +import java.util.List; public class NsdManagerServiceResolver implements ServiceResolver { private static final String TAG = NsdManagerServiceResolver.class.getSimpleName(); @@ -32,6 +34,7 @@ public class NsdManagerServiceResolver implements ServiceResolver { private final NsdManager nsdManager; private MulticastLock multicastLock; private Handler mainThreadHandler; + private List registrationListeners = new ArrayList<>(); public NsdManagerServiceResolver(Context context) { this.nsdManager = (NsdManager) context.getSystemService(Context.NSD_SERVICE); @@ -112,4 +115,57 @@ public void onServiceResolved(NsdServiceInfo serviceInfo) { }); mainThreadHandler.postDelayed(timeoutRunnable, RESOLVE_SERVICE_TIMEOUT); } + + @Override + public void publish( + String serviceName, + String hostName, + String type, + int port, + String[] textEntriesKeys, + byte[][] textEntriesDatas, + String[] subTypes) { + NsdServiceInfo serviceInfo = new NsdServiceInfo(); + serviceInfo.setServiceName(serviceName); + serviceInfo.setServiceType(type); + serviceInfo.setPort(port); + Log.i(TAG, "publish serviceName=" + serviceName + " type=" + type + " port=" + port); + + NsdManager.RegistrationListener registrationListener = + new NsdManager.RegistrationListener() { + @Override + public void onRegistrationFailed(NsdServiceInfo serviceInfo, int errorCode) { + Log.w( + TAG, + "service " + serviceInfo.getServiceName() + " onRegistrationFailed:" + errorCode); + } + + @Override + public void onUnregistrationFailed(NsdServiceInfo serviceInfo, int errorCode) { + Log.w( + TAG, + "service " + serviceInfo.getServiceName() + " onUnregistrationFailed:" + errorCode); + } + + @Override + public void onServiceRegistered(NsdServiceInfo serviceInfo) { + Log.i(TAG, "service " + serviceInfo.getServiceName() + " onServiceRegistered:"); + } + + @Override + public void onServiceUnregistered(NsdServiceInfo serviceInfo) { + Log.i(TAG, "service " + serviceInfo.getServiceName() + " onServiceRegistered:"); + } + }; + registrationListeners.add(registrationListener); + + nsdManager.registerService(serviceInfo, NsdManager.PROTOCOL_DNS_SD, registrationListener); + } + + @Override + public void removeServices() { + for (NsdManager.RegistrationListener l : registrationListeners) { + nsdManager.unregisterService(l); + } + } } diff --git a/src/platform/android/java/chip/platform/ServiceResolver.java b/src/platform/android/java/chip/platform/ServiceResolver.java index e9cf638b005929..f8a50c6e37f0ec 100644 --- a/src/platform/android/java/chip/platform/ServiceResolver.java +++ b/src/platform/android/java/chip/platform/ServiceResolver.java @@ -30,4 +30,22 @@ void resolve( long callbackHandle, long contextHandle, ChipMdnsCallback chipMdnsCallback); + + /** + * Publishes a service via DNS-SD. + * + *

Calling the function again with the same service name, type, protocol, interface and port + * but different text will update the text published. + */ + void publish( + String serviceName, + String hostName, + String type, + int port, + String[] textEntriesKeys, + byte[][] textEntriesDatas, + String[] subTypes); + + /** Removes or marks all services being advertised for removal. */ + void removeServices(); } diff --git a/src/platform/cc13x2_26x2/CHIPDevicePlatformConfig.h b/src/platform/cc13x2_26x2/CHIPDevicePlatformConfig.h index 965bde2f9db848..bddae508acea2b 100644 --- a/src/platform/cc13x2_26x2/CHIPDevicePlatformConfig.h +++ b/src/platform/cc13x2_26x2/CHIPDevicePlatformConfig.h @@ -50,3 +50,8 @@ // disabled for Locks and Barrier Access Devices. #define CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART 0 #define CHIP_DEVICE_CONFIG_ENABLE_PAIRING_AUTOSTART 0 + +#define CHIP_DEVICE_CONFIG_ENABLE_DNSSD 1 +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DISCOVERY 1 diff --git a/src/platform/fake/ConfigurationManagerImpl.h b/src/platform/fake/ConfigurationManagerImpl.h index ba93651e9e0f82..3a78d29a011f49 100644 --- a/src/platform/fake/ConfigurationManagerImpl.h +++ b/src/platform/fake/ConfigurationManagerImpl.h @@ -39,7 +39,7 @@ class ConfigurationManagerImpl final : public ConfigurationManager CHIP_ERROR GetProductRevision(uint16_t & productRev) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR StoreProductRevision(uint16_t productRev) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetFirmwareRevisionString(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR GetFirmwareRevision(uint32_t & firmwareRev) override { return CHIP_ERROR_NOT_IMPLEMENTED; } + CHIP_ERROR GetFirmwareRevision(uint16_t & firmwareRev) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetSerialNumber(char * buf, size_t bufSize, size_t & serialNumLen) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR StoreSerialNumber(const char * serialNum, size_t serialNumLen) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetPrimaryMACAddress(MutableByteSpan buf) override { return CHIP_ERROR_NOT_IMPLEMENTED; } diff --git a/src/platform/tests/TestDnssd.cpp b/src/platform/tests/TestDnssd.cpp index fe08c6ce6255c2..6baa99c1cd7559 100644 --- a/src/platform/tests/TestDnssd.cpp +++ b/src/platform/tests/TestDnssd.cpp @@ -42,7 +42,7 @@ static void HandleBrowse(void * context, DnssdService * services, size_t service printf("Mdns service size %zu\n", servicesSize); printf("Service name %s\n", services->mName); printf("Service type %s\n", services->mType); - NL_TEST_ASSERT(suite, ChipDnssdResolve(services, INET_NULL_INTERFACEID, HandleResolve, suite) == CHIP_NO_ERROR); + NL_TEST_ASSERT(suite, ChipDnssdResolve(services, chip::Inet::InterfaceId::Null(), HandleResolve, suite) == CHIP_NO_ERROR); } } @@ -56,7 +56,7 @@ static void InitCallback(void * context, CHIP_ERROR error) NL_TEST_ASSERT(suite, error == CHIP_NO_ERROR); - service.mInterface = INET_NULL_INTERFACEID; + service.mInterface = chip::Inet::InterfaceId::Null(); service.mPort = 80; strcpy(service.mName, "test"); strcpy(service.mType, "_mock"); @@ -71,8 +71,8 @@ static void InitCallback(void * context, CHIP_ERROR error) service.mSubTypeSize = 0; NL_TEST_ASSERT(suite, ChipDnssdPublishService(&service) == CHIP_NO_ERROR); - ChipDnssdBrowse("_mock", DnssdServiceProtocol::kDnssdProtocolTcp, chip::Inet::IPAddressType::kAny, INET_NULL_INTERFACEID, - HandleBrowse, suite); + ChipDnssdBrowse("_mock", DnssdServiceProtocol::kDnssdProtocolTcp, chip::Inet::IPAddressType::kAny, + chip::Inet::InterfaceId::Null(), HandleBrowse, suite); } static void ErrorCallback(void * context, CHIP_ERROR error) diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp index 7d576426d43733..62294bcdc58f5d 100644 --- a/src/protocols/secure_channel/CASESession.cpp +++ b/src/protocols/secure_channel/CASESession.cpp @@ -325,10 +325,13 @@ CHIP_ERROR CASESession::DeriveSecureSession(CryptoContext & session, CryptoConte CHIP_ERROR CASESession::SendSigma1() { - size_t data_len = EstimateTLVStructOverhead(kSigmaParamRandomNumberSize + sizeof(uint16_t) + kSHA256_Hash_Length + - kP256_PublicKey_Length /* + kMRPOptionalParamsLength */ + - kCASEResumptionIDSize + CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES, - 7); + size_t data_len = EstimateTLVStructOverhead(kSigmaParamRandomNumberSize, // initiatorRandom + sizeof(uint16_t), // initiatorSessionId, + kSHA256_Hash_Length, // destinationId + kP256_PublicKey_Length, // InitiatorEphPubKey, + /* EstimateTLVStructOverhead(sizeof(uint16_t), + sizeof(uint16)_t), // initiatorMRPParams */ + kCASEResumptionIDSize, CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES); System::PacketBufferTLVWriter tlvWriter; System::PacketBufferHandle msg_R1; @@ -489,8 +492,8 @@ CHIP_ERROR CASESession::HandleSigma1(System::PacketBufferHandle && msg) CHIP_ERROR CASESession::SendSigma2Resume(const ByteSpan & initiatorRandom) { - size_t max_sigma2_resume_data_len = EstimateTLVStructOverhead( - kCASEResumptionIDSize + CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES + sizeof(uint16_t) /* + kMRPOptionalParamsLength */, 4); + size_t max_sigma2_resume_data_len = EstimateTLVStructOverhead(kCASEResumptionIDSize, CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES, + sizeof(uint16_t) /*, kMRPOptionalParamsLength, */); System::PacketBufferTLVWriter tlvWriter; System::PacketBufferHandle msg_R2_resume; @@ -573,7 +576,8 @@ CHIP_ERROR CASESession::SendSigma2() kKDFInfoLength, sr2k, CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES)); // Construct Sigma2 TBS Data - size_t msg_r2_signed_len = EstimateTLVStructOverhead(nocCert.size() + icaCert.size() + kP256_PublicKey_Length * 2, 4); + size_t msg_r2_signed_len = + EstimateTLVStructOverhead(nocCert.size(), icaCert.size(), kP256_PublicKey_Length, kP256_PublicKey_Length); chip::Platform::ScopedMemoryBuffer msg_R2_Signed; VerifyOrReturnError(msg_R2_Signed.Alloc(msg_r2_signed_len), CHIP_ERROR_NO_MEMORY); @@ -592,7 +596,7 @@ CHIP_ERROR CASESession::SendSigma2() // Construct Sigma2 TBE Data size_t msg_r2_signed_enc_len = - EstimateTLVStructOverhead(nocCert.size() + icaCert.size() + tbsData2Signature.Length() + kCASEResumptionIDSize, 4); + EstimateTLVStructOverhead(nocCert.size(), icaCert.size(), tbsData2Signature.Length(), kCASEResumptionIDSize); chip::Platform::ScopedMemoryBuffer msg_R2_Encrypted; VerifyOrReturnError(msg_R2_Encrypted.Alloc(msg_r2_signed_enc_len + CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES), CHIP_ERROR_NO_MEMORY); @@ -626,9 +630,8 @@ CHIP_ERROR CASESession::SendSigma2() CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES)); // Construct Sigma2 Msg - size_t data_len = EstimateTLVStructOverhead(kSigmaParamRandomNumberSize + sizeof(uint16_t) + kP256_PublicKey_Length + - msg_r2_signed_enc_len + CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES, - 4); + size_t data_len = EstimateTLVStructOverhead(kSigmaParamRandomNumberSize, sizeof(uint16_t), kP256_PublicKey_Length, + msg_r2_signed_enc_len + CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES); System::PacketBufferHandle msg_R2 = System::PacketBufferHandle::New(data_len); VerifyOrReturnError(!msg_R2.IsNull(), CHIP_ERROR_NO_MEMORY); @@ -842,8 +845,8 @@ CHIP_ERROR CASESession::HandleSigma2(System::PacketBufferHandle && msg) SuccessOrExit(err = Validate_and_RetrieveResponderID(responderNOC, responderICAC, remoteCredential)); // Construct msg_R2_Signed and validate the signature in msg_r2_encrypted - msg_r2_signed_len = - EstimateTLVStructOverhead(sizeof(uint16_t) + responderNOC.size() + responderICAC.size() + kP256_PublicKey_Length * 2, 4); + msg_r2_signed_len = EstimateTLVStructOverhead(sizeof(uint16_t), responderNOC.size(), responderICAC.size(), + kP256_PublicKey_Length, kP256_PublicKey_Length); VerifyOrExit(msg_R2_Signed.Alloc(msg_r2_signed_len), err = CHIP_ERROR_NO_MEMORY); @@ -905,7 +908,7 @@ CHIP_ERROR CASESession::SendSigma3() VerifyOrExit(!mTrustedRootId.empty(), err = CHIP_ERROR_INTERNAL); // Prepare Sigma3 TBS Data Blob - msg_r3_signed_len = EstimateTLVStructOverhead(icaCert.size() + nocCert.size() + kP256_PublicKey_Length * 2, 4); + msg_r3_signed_len = EstimateTLVStructOverhead(icaCert.size(), nocCert.size(), kP256_PublicKey_Length, kP256_PublicKey_Length); VerifyOrExit(msg_R3_Signed.Alloc(msg_r3_signed_len), err = CHIP_ERROR_NO_MEMORY); @@ -918,7 +921,7 @@ CHIP_ERROR CASESession::SendSigma3() SuccessOrExit(err); // Prepare Sigma3 TBE Data Blob - msg_r3_encrypted_len = EstimateTLVStructOverhead(nocCert.size() + icaCert.size() + tbsData3Signature.Length(), 3); + msg_r3_encrypted_len = EstimateTLVStructOverhead(nocCert.size(), icaCert.size(), tbsData3Signature.Length()); VerifyOrExit(msg_R3_Encrypted.Alloc(msg_r3_encrypted_len + CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES), err = CHIP_ERROR_NO_MEMORY); @@ -959,7 +962,7 @@ CHIP_ERROR CASESession::SendSigma3() SuccessOrExit(err); // Generate Sigma3 Msg - data_len = EstimateTLVStructOverhead(CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES + msg_r3_encrypted_len, 1); + data_len = EstimateTLVStructOverhead(CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES + msg_r3_encrypted_len); msg_R3 = System::PacketBufferHandle::New(data_len); VerifyOrExit(!msg_R3.IsNull(), err = CHIP_ERROR_NO_MEMORY); @@ -1096,8 +1099,8 @@ CHIP_ERROR CASESession::HandleSigma3(System::PacketBufferHandle && msg) SuccessOrExit(err = Validate_and_RetrieveResponderID(initiatorNOC, initiatorICAC, remoteCredential)); // Step 4 - Construct Sigma3 TBS Data - msg_r3_signed_len = - EstimateTLVStructOverhead(sizeof(uint16_t) + initiatorNOC.size() + initiatorICAC.size() + kP256_PublicKey_Length * 2, 4); + msg_r3_signed_len = EstimateTLVStructOverhead(sizeof(uint16_t), initiatorNOC.size(), initiatorICAC.size(), + kP256_PublicKey_Length, kP256_PublicKey_Length); VerifyOrExit(msg_R3_Signed.Alloc(msg_r3_signed_len), err = CHIP_ERROR_NO_MEMORY); diff --git a/src/protocols/secure_channel/CASESession.h b/src/protocols/secure_channel/CASESession.h index 90199a8050126b..012cae3b4b8092 100644 --- a/src/protocols/secure_channel/CASESession.h +++ b/src/protocols/secure_channel/CASESession.h @@ -237,11 +237,6 @@ class DLL_EXPORT CASESession : public Messaging::ExchangeDelegate, public Pairin CHIP_ERROR ValidateSigmaResumeMIC(const ByteSpan & resumeMIC, const ByteSpan & initiatorRandom, const ByteSpan & resumptionID, const ByteSpan & skInfo, const ByteSpan & nonce); - static constexpr size_t EstimateTLVStructOverhead(size_t dataLen, size_t nFields) - { - return dataLen + (sizeof(uint64_t) * nFields); - } - void OnSuccessStatusReport() override; CHIP_ERROR OnFailureStatusReport(Protocols::SecureChannel::GeneralStatusCode generalCode, uint16_t protocolCode) override; diff --git a/src/protocols/secure_channel/PASESession.cpp b/src/protocols/secure_channel/PASESession.cpp index d4f0c4724f6325..3a0e8d84944dfd 100644 --- a/src/protocols/secure_channel/PASESession.cpp +++ b/src/protocols/secure_channel/PASESession.cpp @@ -352,8 +352,13 @@ CHIP_ERROR PASESession::SendPBKDFParamRequest() { ReturnErrorOnFailure(DRBG_get_bytes(mPBKDFLocalRandomData, sizeof(mPBKDFLocalRandomData))); - const size_t max_msg_len = - EstimateTLVStructOverhead(kPBKDFParamRandomNumberSize + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint8_t), 4); + const size_t max_msg_len = EstimateTLVStructOverhead(kPBKDFParamRandomNumberSize, // initiatorRandom, + sizeof(uint16_t), // initiatorSessionId + sizeof(uint16_t), // passcodeId, + sizeof(uint8_t) // hasPBKDFParameters + /* EstimateTLVStructOverhead(sizeof(uint16_t), + sizeof(uint16)_t), // initiatorMRPParams */ + ); System::PacketBufferHandle req = System::PacketBufferHandle::New(max_msg_len); VerifyOrReturnError(!req.IsNull(), CHIP_ERROR_NO_MEMORY); @@ -367,6 +372,8 @@ CHIP_ERROR PASESession::SendPBKDFParamRequest() ReturnErrorOnFailure(tlvWriter.Put(TLV::ContextTag(3), mPasscodeID)); ReturnErrorOnFailure(tlvWriter.PutBoolean(TLV::ContextTag(4), mHavePBKDFParameters)); // TODO - Add optional MRP parameter support to PASE + // When we add MRP params here, adjust the EstimateTLVStructOverhead call + // above accordingly. ReturnErrorOnFailure(tlvWriter.EndContainer(outerContainerType)); ReturnErrorOnFailure(tlvWriter.Finalize(&req)); @@ -443,8 +450,14 @@ CHIP_ERROR PASESession::SendPBKDFParamResponse(ByteSpan initiatorRandom, bool in { ReturnErrorOnFailure(DRBG_get_bytes(mPBKDFLocalRandomData, sizeof(mPBKDFLocalRandomData))); - const size_t max_msg_len = EstimateTLVStructOverhead( - kPBKDFParamRandomNumberSize + kPBKDFParamRandomNumberSize + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint8_t), 5); + const size_t max_msg_len = + EstimateTLVStructOverhead(kPBKDFParamRandomNumberSize, // initiatorRandom + kPBKDFParamRandomNumberSize, // responderRandom + sizeof(uint16_t), // responderSessionId + EstimateTLVStructOverhead(sizeof(uint32_t), mSaltLength) // pbkdf_parameters + /* EstimateTLVStructOverhead(sizeof(uint16_t), + sizeof(uint16)_t), // responderMRPParams */ + ); System::PacketBufferHandle resp = System::PacketBufferHandle::New(max_msg_len); VerifyOrReturnError(!resp.IsNull(), CHIP_ERROR_NO_MEMORY); @@ -467,6 +480,9 @@ CHIP_ERROR PASESession::SendPBKDFParamResponse(ByteSpan initiatorRandom, bool in ReturnErrorOnFailure(tlvWriter.EndContainer(pbkdfParamContainer)); } + // When we add MRP params here, adjust the EstimateTLVStructOverhead call + // above accordingly. + ReturnErrorOnFailure(tlvWriter.EndContainer(outerContainerType)); ReturnErrorOnFailure(tlvWriter.Finalize(&resp)); @@ -566,7 +582,7 @@ CHIP_ERROR PASESession::HandlePBKDFParamResponse(System::PacketBufferHandle && m CHIP_ERROR PASESession::SendMsg1() { - const size_t max_msg_len = EstimateTLVStructOverhead(kMAX_Point_Length, 1); + const size_t max_msg_len = EstimateTLVStructOverhead(kMAX_Point_Length); System::PacketBufferHandle msg = System::PacketBufferHandle::New(max_msg_len); VerifyOrReturnError(!msg.IsNull(), CHIP_ERROR_NO_MEMORY); @@ -633,7 +649,7 @@ CHIP_ERROR PASESession::HandleMsg1_and_SendMsg2(System::PacketBufferHandle && ms msg1 = nullptr; { - const size_t max_msg_len = EstimateTLVStructOverhead(Y_len + verifier_len, 2); + const size_t max_msg_len = EstimateTLVStructOverhead(Y_len, verifier_len); constexpr uint8_t kPake2_pB = 1; constexpr uint8_t kPake2_cB = 2; @@ -710,7 +726,7 @@ CHIP_ERROR PASESession::HandleMsg2_and_SendMsg3(System::PacketBufferHandle && ms msg2 = nullptr; { - const size_t max_msg_len = EstimateTLVStructOverhead(verifier_len, 1); + const size_t max_msg_len = EstimateTLVStructOverhead(verifier_len); constexpr uint8_t kPake3_cB = 1; System::PacketBufferHandle msg3 = System::PacketBufferHandle::New(max_msg_len); diff --git a/src/protocols/secure_channel/PASESession.h b/src/protocols/secure_channel/PASESession.h index 6c3c0be6274011..7a7e86de881738 100644 --- a/src/protocols/secure_channel/PASESession.h +++ b/src/protocols/secure_channel/PASESession.h @@ -269,9 +269,6 @@ class DLL_EXPORT PASESession : public Messaging::ExchangeDelegate, public Pairin void OnSuccessStatusReport() override; CHIP_ERROR OnFailureStatusReport(Protocols::SecureChannel::GeneralStatusCode generalCode, uint16_t protocolCode) override; - // TODO - Move EstimateTLVStructOverhead to CHIPTLV header file - constexpr size_t EstimateTLVStructOverhead(size_t dataLen, size_t nFields) { return dataLen + (sizeof(uint64_t) * nFields); } - void CloseExchange(); SessionEstablishmentDelegate * mDelegate = nullptr; diff --git a/src/protocols/secure_channel/tests/TestCASESession.cpp b/src/protocols/secure_channel/tests/TestCASESession.cpp index d249fce013244f..71bb95f176e033 100644 --- a/src/protocols/secure_channel/tests/TestCASESession.cpp +++ b/src/protocols/secure_channel/tests/TestCASESession.cpp @@ -692,9 +692,9 @@ CHIP_ERROR CASETestSecurePairingSetup(void * inContext) ReturnErrorOnFailure(chip::Platform::MemoryInit()); gTransportMgr.Init(&gLoopback); - ReturnErrorOnFailure(gIOContext.Init(&sSuite)); + ReturnErrorOnFailure(gIOContext.Init()); - ReturnErrorOnFailure(ctx.Init(&sSuite, &gTransportMgr, &gIOContext)); + ReturnErrorOnFailure(ctx.Init(&gTransportMgr, &gIOContext)); ctx.SetBobNodeId(kPlaceholderNodeId); ctx.SetAliceNodeId(kPlaceholderNodeId); diff --git a/src/protocols/secure_channel/tests/TestPASESession.cpp b/src/protocols/secure_channel/tests/TestPASESession.cpp index b265163a1f40db..0491207cb42a27 100644 --- a/src/protocols/secure_channel/tests/TestPASESession.cpp +++ b/src/protocols/secure_channel/tests/TestPASESession.cpp @@ -374,11 +374,11 @@ int TestSecurePairing_Setup(void * inContext) { // Initialize System memory and resources VerifyOrReturnError(chip::Platform::MemoryInit() == CHIP_NO_ERROR, FAILURE); - VerifyOrReturnError(gIOContext.Init(&sSuite) == CHIP_NO_ERROR, FAILURE); + VerifyOrReturnError(gIOContext.Init() == CHIP_NO_ERROR, FAILURE); VerifyOrReturnError(gTransportMgr.Init(&gLoopback) == CHIP_NO_ERROR, FAILURE); auto & ctx = *static_cast(inContext); - VerifyOrReturnError(ctx.Init(&sSuite, &gTransportMgr, &gIOContext) == CHIP_NO_ERROR, FAILURE); + VerifyOrReturnError(ctx.Init(&gTransportMgr, &gIOContext) == CHIP_NO_ERROR, FAILURE); ctx.SetBobNodeId(kPlaceholderNodeId); ctx.SetAliceNodeId(kPlaceholderNodeId); diff --git a/src/tools/chip-cert/BUILD.gn b/src/tools/chip-cert/BUILD.gn index 8b5c0253ed9431..0a7dc172c585e2 100644 --- a/src/tools/chip-cert/BUILD.gn +++ b/src/tools/chip-cert/BUILD.gn @@ -24,6 +24,7 @@ executable("chip-cert") { "Cmd_ConvertCert.cpp", "Cmd_ConvertKey.cpp", "Cmd_GenAttCert.cpp", + "Cmd_GenCD.cpp", "Cmd_GenCert.cpp", "Cmd_PrintCert.cpp", "Cmd_ResignCert.cpp", diff --git a/src/tools/chip-cert/CertUtils.cpp b/src/tools/chip-cert/CertUtils.cpp index adbe70e54d9ade..440531d18d30f8 100644 --- a/src/tools/chip-cert/CertUtils.cpp +++ b/src/tools/chip-cert/CertUtils.cpp @@ -97,8 +97,8 @@ bool ToolChipDN::SetCertSubjectDN(X509 * cert) const else { if (!X509_NAME_add_entry_by_NID(X509_get_subject_name(cert), attrNID, MBSTRING_UTF8, - const_cast(rdn[i].mString.data()), static_cast(rdn[i].mString.size()), - -1, 0)) + reinterpret_cast(const_cast(rdn[i].mString.data())), + static_cast(rdn[i].mString.size()), -1, 0)) { ReportOpenSSLErrorAndExit("X509_NAME_add_entry_by_NID", res = false); } @@ -166,7 +166,7 @@ namespace { CertFormat DetectCertFormat(uint8_t * cert, uint32_t certLen) { static const uint8_t chipRawPrefix[] = { 0x15, 0x30, 0x01 }; - static const char * chipB64Prefix = "FTABC"; + static const char * chipB64Prefix = "FTAB"; static const size_t chipB64PrefixLen = strlen(chipB64Prefix); static const char * pemMarker = "-----BEGIN CERTIFICATE-----"; diff --git a/src/tools/chip-cert/Cmd_GenAttCert.cpp b/src/tools/chip-cert/Cmd_GenAttCert.cpp index 0c7f12b4191764..c01769d1f71064 100644 --- a/src/tools/chip-cert/Cmd_GenAttCert.cpp +++ b/src/tools/chip-cert/Cmd_GenAttCert.cpp @@ -150,8 +150,6 @@ struct tm gValidFrom; bool HandleOption(const char * progName, OptionSet * optSet, int id, const char * name, const char * arg) { - uint64_t chip64bitAttr; - switch (id) { case 't': @@ -181,20 +179,18 @@ bool HandleOption(const char * progName, OptionSet * optSet, int id, const char gSubjectCN = arg; break; case 'V': - if (!ParseChip64bitAttr(arg, chip64bitAttr) || !chip::CanCastTo(chip64bitAttr)) + if (!ParseInt(arg, gSubjectVID, 16)) { PrintArgError("%s: Invalid value specified for the subject VID attribute: %s\n", progName, arg); return false; } - gSubjectVID = static_cast(chip64bitAttr); break; case 'P': - if (!ParseChip64bitAttr(arg, chip64bitAttr) || !chip::CanCastTo(chip64bitAttr)) + if (!ParseInt(arg, gSubjectPID, 16)) { PrintArgError("%s: Invalid value specified for the subject PID attribute: %s\n", progName, arg); return false; } - gSubjectPID = static_cast(chip64bitAttr); break; case 'k': gInKeyFileName = arg; diff --git a/src/tools/chip-cert/Cmd_GenCD.cpp b/src/tools/chip-cert/Cmd_GenCD.cpp new file mode 100644 index 00000000000000..4509a7f8b2e2b8 --- /dev/null +++ b/src/tools/chip-cert/Cmd_GenCD.cpp @@ -0,0 +1,367 @@ +/* + * + * Copyright (c) 2021 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 + * This file implements the command handler for the 'chip-cert' tool + * that generates a CHIP Certification Declaration. + * + */ + +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif + +#include "chip-cert.h" + +#include + +namespace { + +using namespace chip; +using namespace chip::ArgParser; +using namespace chip::Credentials; +using namespace chip::Crypto; + +#define CMD_NAME "chip-cert gen-cd" + +bool HandleOption(const char * progName, OptionSet * optSet, int id, const char * name, const char * arg); + +// clang-format off +OptionDef gCmdOptionDefs[] = +{ + { "key", kArgumentRequired, 'K' }, + { "cert", kArgumentRequired, 'C' }, + { "out", kArgumentRequired, 'O' }, + { "format-version", kArgumentRequired, 'f' }, + { "vendor-id", kArgumentRequired, 'V' }, + { "product-id", kArgumentRequired, 'p' }, + { "device-type-id", kArgumentRequired, 'd' }, + { "certificate-id", kArgumentRequired, 'c' }, + { "security-level", kArgumentRequired, 'l' }, + { "security-info", kArgumentRequired, 'i' }, + { "version-number", kArgumentRequired, 'n' }, + { "certification-type", kArgumentRequired, 't' }, + { "dac-origin-vendor-id", kArgumentRequired, 'o' }, + { "dac-origin-product-id", kArgumentRequired, 'r' }, + { } +}; + +const char * const gCmdOptionHelp = + " -K, --key \n" + "\n" + " File containing private key to be used to sign the Certification Declaration.\n" + "\n" + " -C, --cert \n" + "\n" + " File containing certificate associated with the private key that is used\n" + " to sign the Certification Declaration. The Subject Key Identifier in the\n" + " certificate will be included in the signed Certification Declaration message.\n" + "\n" + " -O, --out \n" + "\n" + " File to contain the signed Certification Declaration message.\n" + "\n" + " -f, --format-version \n" + "\n" + " Format Version.\n" + "\n" + " -V, --vendor-id \n" + "\n" + " Vendor Id (VID) in hex.\n" + "\n" + " -p, --product-id \n" + "\n" + " Product Id (PID) in hex. Maximum 100 PID values can be specified.\n" + " Each PID value should have it's own -p or --product-id option selector.\n" + "\n" + " -d, --device-type-id \n" + "\n" + " Device Type Id in hex.\n" + "\n" + " -c, --certificate-id \n" + "\n" + " Certificate Id encoded as UTF8 string.\n" + "\n" + " -l, --security-level \n" + "\n" + " Security Level in hex.\n" + "\n" + " -i, --security-info \n" + "\n" + " Security Information in hex.\n" + "\n" + " -n, --version-number \n" + "\n" + " Version Number in hex.\n" + "\n" + " -t, --certification-type \n" + "\n" + " Certification Type. Valid values are:\n" + " 0 - Development and Test (default)\n" + " 1 - Provisional\n" + " 2 - Official\n" + "\n" + " -o, --dac-origin-vendor-id \n" + "\n" + " DAC Origin Vendor Id in hex.\n" + "\n" + " -r, --dac-origin-product-id \n" + "\n" + " DAC Origin Product Id in hex.\n" + "\n" + ; + +OptionSet gCmdOptions = +{ + HandleOption, + gCmdOptionDefs, + "COMMAND OPTIONS", + gCmdOptionHelp +}; + +HelpOptions gHelpOptions( + CMD_NAME, + "Usage: " CMD_NAME " [ ]\n", + CHIP_VERSION_STRING "\n" COPYRIGHT_STRING, + "Generate CD CMS Signed Message" +); + +OptionSet *gCmdOptionSets[] = +{ + &gCmdOptions, + &gHelpOptions, + nullptr +}; +// clang-format on + +CertificationElements gCertElements = { 0 }; +const char * gCertFileName = nullptr; +const char * gKeyFileName = nullptr; +const char * gSignedCDFileName = nullptr; + +bool HandleOption(const char * progName, OptionSet * optSet, int id, const char * name, const char * arg) +{ + switch (id) + { + case 'C': + gCertFileName = arg; + break; + case 'K': + gKeyFileName = arg; + break; + case 'O': + gSignedCDFileName = arg; + break; + case 'f': + if (!ParseInt(arg, gCertElements.FormatVersion, 16)) + { + PrintArgError("%s: Invalid value specified for Format Version: %s\n", progName, arg); + return false; + } + break; + case 'V': + if (!ParseInt(arg, gCertElements.VendorId, 16) || gCertElements.VendorId == 0) + { + PrintArgError("%s: Invalid value specified for Vendor Id: %s\n", progName, arg); + return false; + } + break; + case 'p': + if (gCertElements.ProductIdsCount == ArraySize(gCertElements.ProductIds)) + { + PrintArgError("%s: Too many Product Ids are specified: %s\n", progName, arg); + return false; + } + if (!ParseInt(arg, gCertElements.ProductIds[gCertElements.ProductIdsCount], 16) || + gCertElements.ProductIds[gCertElements.ProductIdsCount] == 0) + { + PrintArgError("%s: Invalid value specified for Product Id: %s\n", progName, arg); + return false; + } + gCertElements.ProductIdsCount++; + break; + case 'd': + if (!ParseInt(arg, gCertElements.DeviceTypeId, 16)) + { + PrintArgError("%s: Invalid value specified for Device Type Id: %s\n", progName, arg); + return false; + } + break; + case 'c': + if (strlen(arg) != kCertificateIdLength) + { + PrintArgError("%s: Invalid value specified for Certificate Id: %s\n", progName, arg); + return false; + } + memcpy(gCertElements.CertificateId, arg, strlen(arg)); + gCertElements.CertificateId[kCertificateIdLength] = '\0'; + break; + case 'l': + if (!ParseInt(arg, gCertElements.SecurityLevel, 16)) + { + PrintArgError("%s: Invalid value specified for Security Level: %s\n", progName, arg); + return false; + } + break; + case 'i': + if (!ParseInt(arg, gCertElements.SecurityInformation, 16)) + { + PrintArgError("%s: Invalid value specified for Security Information: %s\n", progName, arg); + return false; + } + break; + case 'n': + if (!ParseInt(arg, gCertElements.VersionNumber, 16)) + { + PrintArgError("%s: Invalid value specified for Version Number: %s\n", progName, arg); + return false; + } + break; + case 't': + if (!ParseInt(arg, gCertElements.CertificationType) || gCertElements.CertificationType > 2) + { + PrintArgError("%s: Invalid value specified for Certification Type: %s\n", progName, arg); + return false; + } + break; + case 'o': + if (!ParseInt(arg, gCertElements.DACOriginVendorId, 16) || gCertElements.DACOriginVendorId == 0) + { + PrintArgError("%s: Invalid value specified for DAC Origin Vendor Id: %s\n", progName, arg); + return false; + } + gCertElements.DACOriginVIDandPIDPresent = true; + break; + case 'r': + if (!ParseInt(arg, gCertElements.DACOriginProductId, 16) || gCertElements.DACOriginProductId == 0) + { + PrintArgError("%s: Invalid value specified for DAC Origin Product Id: %s\n", progName, arg); + return false; + } + gCertElements.DACOriginVIDandPIDPresent = true; + break; + default: + PrintArgError("%s: Unhandled option: %s\n", progName, name); + return false; + } + + return true; +} + +} // namespace + +bool Cmd_GenCD(int argc, char * argv[]) +{ + if (argc == 1) + { + gHelpOptions.PrintBriefUsage(stderr); + return true; + } + + VerifyOrReturnError(ParseArgs(CMD_NAME, argc, argv, gCmdOptionSets), false); + + if (gKeyFileName == nullptr) + { + fprintf(stderr, "Please specify the signing private key file name using the --key option.\n"); + return false; + } + + if (gCertFileName == nullptr) + { + fprintf(stderr, "Please specify the signing certificate file name using the --cert option.\n"); + return false; + } + + if (gSignedCDFileName == nullptr) + { + fprintf(stderr, "Please specify the file name for the signed Certification Declaration using the --out option.\n"); + return false; + } + + if (gCertElements.VendorId == 0 || gCertElements.ProductIdsCount == 0 || gCertElements.DeviceTypeId == 0 || + strlen(gCertElements.CertificateId) == 0 || gCertElements.VersionNumber == 0) + { + fprintf(stderr, "Please specify all mandatory CD elements.\n"); + return false; + } + + if (gCertElements.DACOriginVIDandPIDPresent && (gCertElements.DACOriginVendorId == 0 || gCertElements.DACOriginProductId == 0)) + { + fprintf(stderr, "The DAC Origin Vendor Id and Product Id SHALL be specified together.\n"); + return false; + } + + if (strcmp(gSignedCDFileName, "-") != 0 && access(gSignedCDFileName, R_OK) == 0) + { + fprintf(stderr, + "Output signed CD file already exists (%s)\n" + "To replace the file, please remove it and re-run the command.\n", + gSignedCDFileName); + return false; + } + + { + std::unique_ptr cert(X509_new(), &X509_free); + std::unique_ptr key(EVP_PKEY_new(), &EVP_PKEY_free); + + VerifyOrReturnError(ReadCert(gCertFileName, cert.get()), false); + VerifyOrReturnError(ReadKey(gKeyFileName, key.get()), false); + + // Extract the subject key id from the X509 certificate. + ByteSpan signerKeyId; + { + const ASN1_OCTET_STRING * skidString = X509_get0_subject_key_id(cert.get()); + VerifyOrReturnError(skidString != nullptr, false); + VerifyOrReturnError(CanCastTo(skidString->length), false); + signerKeyId = ByteSpan(skidString->data, static_cast(skidString->length)); + } + + // Initialize P256Keypair from EVP_PKEY. + P256Keypair keypair; + { + P256SerializedKeypair serializedKeypair; + VerifyOrReturnError(SerializeKeyPair(key.get(), serializedKeypair), false); + VerifyOrReturnError(keypair.Deserialize(serializedKeypair) == CHIP_NO_ERROR, false); + } + + // Encode CD TLV content. + uint8_t encodedCDBuf[kCertificationElements_TLVEncodedMaxLength]; + MutableByteSpan encodedCD(encodedCDBuf); + VerifyOrReturnError(EncodeCertificationElements(gCertElements, encodedCD) == CHIP_NO_ERROR, false); + + // Sign CD. + uint8_t signedMessageBuf[kMaxCMSSignedCDMessage]; + MutableByteSpan signedMessage(signedMessageBuf); + VerifyOrReturnError(CMS_Sign(encodedCD, signerKeyId, keypair, signedMessage) == CHIP_NO_ERROR, false); + + // Write to file. + { + FILE * file = nullptr; + + VerifyOrReturnError(OpenFile(gSignedCDFileName, file, true), false); + + if (fwrite(signedMessage.data(), 1, signedMessage.size(), file) != signedMessage.size()) + { + fprintf(stderr, "Unable to write to %s: %s\n", gSignedCDFileName, strerror(ferror(file) ? errno : ENOSPC)); + return false; + } + } + } + return true; +} diff --git a/src/tools/chip-cert/Cmd_GenCert.cpp b/src/tools/chip-cert/Cmd_GenCert.cpp index 4fc61e92415918..7eaba4d87749e9 100644 --- a/src/tools/chip-cert/Cmd_GenCert.cpp +++ b/src/tools/chip-cert/Cmd_GenCert.cpp @@ -192,6 +192,7 @@ bool HandleOption(const char * progName, OptionSet * optSet, int id, const char { CHIP_ERROR err = CHIP_NO_ERROR; uint64_t chip64bitAttr; + uint32_t chip32bitAttr; OID attrOID; switch (id) @@ -226,7 +227,7 @@ bool HandleOption(const char * progName, OptionSet * optSet, int id, const char break; case 'i': - if (!ParseChip64bitAttr(arg, chip64bitAttr)) + if (!ParseInt(arg, chip64bitAttr, 16)) { PrintArgError("%s: Invalid value specified for subject chip id attribute: %s\n", progName, arg); return false; @@ -260,7 +261,7 @@ bool HandleOption(const char * progName, OptionSet * optSet, int id, const char break; case 'a': - if (!ParseChip64bitAttr(arg, chip64bitAttr)) + if (!ParseInt(arg, chip32bitAttr, 16)) { PrintArgError("%s: Invalid value specified for the subject authentication tag attribute: %s\n", progName, arg); return false; @@ -280,7 +281,7 @@ bool HandleOption(const char * progName, OptionSet * optSet, int id, const char return false; } - err = gSubjectDN.AddAttribute(attrOID, chip64bitAttr); + err = gSubjectDN.AddAttribute(attrOID, chip32bitAttr); if (err != CHIP_NO_ERROR) { fprintf(stderr, "Failed to add subject DN attribute: %s\n", chip::ErrorStr(err)); @@ -296,7 +297,7 @@ bool HandleOption(const char * progName, OptionSet * optSet, int id, const char } break; case 'f': - if (!ParseChip64bitAttr(arg, chip64bitAttr)) + if (!ParseInt(arg, chip64bitAttr, 16)) { PrintArgError("%s: Invalid value specified for subject fabric id attribute: %s\n", progName, arg); return false; @@ -311,8 +312,7 @@ bool HandleOption(const char * progName, OptionSet * optSet, int id, const char break; case 'c': - err = gSubjectDN.AddAttribute(kOID_AttributeType_CommonName, - chip::ByteSpan(reinterpret_cast(arg), strlen(arg))); + err = gSubjectDN.AddAttribute(kOID_AttributeType_CommonName, chip::CharSpan(arg, strlen(arg))); if (err != CHIP_NO_ERROR) { fprintf(stderr, "Failed to add Common Name attribute to the subject DN: %s\n", chip::ErrorStr(err)); diff --git a/src/tools/chip-cert/GeneralUtils.cpp b/src/tools/chip-cert/GeneralUtils.cpp index 8641a6e9c59dde..23adb060aca962 100644 --- a/src/tools/chip-cert/GeneralUtils.cpp +++ b/src/tools/chip-cert/GeneralUtils.cpp @@ -177,15 +177,6 @@ bool ContainsPEMMarker(const char * marker, const uint8_t * data, uint32_t dataL return false; } -bool ParseChip64bitAttr(const char * str, uint64_t & val) -{ - char * parseEnd; - - errno = 0; - val = strtoull(str, &parseEnd, 16); - return parseEnd > str && *parseEnd == 0 && (val != ULLONG_MAX || errno == 0); -} - bool ParseDateTime(const char * str, struct tm & date) { const char * p; diff --git a/src/tools/chip-cert/KeyUtils.cpp b/src/tools/chip-cert/KeyUtils.cpp index 01a76975da6a73..c41d31c7095e3d 100644 --- a/src/tools/chip-cert/KeyUtils.cpp +++ b/src/tools/chip-cert/KeyUtils.cpp @@ -66,45 +66,6 @@ KeyFormat DetectKeyFormat(const uint8_t * key, uint32_t keyLen) return kKeyFormat_X509_DER; } -bool SerializeKeyPair(EVP_PKEY * key, uint8_t * chipKey, uint32_t chipKeyBufSize, uint32_t & chipKeyLen) -{ - bool res = true; - const BIGNUM * privKeyBN = nullptr; - const EC_GROUP * group = nullptr; - const EC_KEY * ecKey = nullptr; - const EC_POINT * ecPoint = nullptr; - uint8_t * pubKey = chipKey; - uint8_t * privKey = chipKey + kP256_PublicKey_Length; - size_t pubKeyLen = 0; - int privKeyLen = 0; - - VerifyOrExit(chipKeyBufSize >= kP256_PublicKey_Length + kP256_PrivateKey_Length, res = false); - - ecKey = EVP_PKEY_get1_EC_KEY(key); - VerifyOrExit(ecKey != nullptr, res = false); - - privKeyBN = EC_KEY_get0_private_key(ecKey); - VerifyOrExit(privKeyBN != nullptr, res = false); - - group = EC_KEY_get0_group(ecKey); - VerifyOrExit(group != nullptr, res = false); - - ecPoint = EC_KEY_get0_public_key(ecKey); - VerifyOrExit(ecPoint != nullptr, res = false); - - pubKeyLen = - EC_POINT_point2oct(group, ecPoint, POINT_CONVERSION_UNCOMPRESSED, Uint8::to_uchar(pubKey), kP256_PublicKey_Length, nullptr); - VerifyOrExit(pubKeyLen == kP256_PublicKey_Length, res = false); - - privKeyLen = BN_bn2binpad(privKeyBN, privKey, kP256_PrivateKey_Length); - VerifyOrExit(privKeyLen == kP256_PrivateKey_Length, res = false); - - chipKeyLen = kP256_PublicKey_Length + kP256_PrivateKey_Length; - -exit: - return res; -} - bool DeserializeKeyPair(const uint8_t * keyPair, uint32_t keyPairLen, EVP_PKEY * key) { bool res = true; @@ -144,6 +105,43 @@ bool DeserializeKeyPair(const uint8_t * keyPair, uint32_t keyPairLen, EVP_PKEY * } // namespace +bool SerializeKeyPair(EVP_PKEY * key, P256SerializedKeypair & serializedKeypair) +{ + bool res = true; + const BIGNUM * privKeyBN = nullptr; + const EC_GROUP * group = nullptr; + const EC_KEY * ecKey = nullptr; + const EC_POINT * ecPoint = nullptr; + uint8_t * pubKey = serializedKeypair; + uint8_t * privKey = pubKey + kP256_PublicKey_Length; + size_t pubKeyLen = 0; + int privKeyLen = 0; + + ecKey = EVP_PKEY_get1_EC_KEY(key); + VerifyOrExit(ecKey != nullptr, res = false); + + privKeyBN = EC_KEY_get0_private_key(ecKey); + VerifyOrExit(privKeyBN != nullptr, res = false); + + group = EC_KEY_get0_group(ecKey); + VerifyOrExit(group != nullptr, res = false); + + ecPoint = EC_KEY_get0_public_key(ecKey); + VerifyOrExit(ecPoint != nullptr, res = false); + + pubKeyLen = + EC_POINT_point2oct(group, ecPoint, POINT_CONVERSION_UNCOMPRESSED, Uint8::to_uchar(pubKey), kP256_PublicKey_Length, nullptr); + VerifyOrExit(pubKeyLen == kP256_PublicKey_Length, res = false); + + privKeyLen = BN_bn2binpad(privKeyBN, privKey, kP256_PrivateKey_Length); + VerifyOrExit(privKeyLen == kP256_PrivateKey_Length, res = false); + + serializedKeypair.SetLength(kP256_PublicKey_Length + kP256_PrivateKey_Length); + +exit: + return res; +} + bool ReadKey(const char * fileName, EVP_PKEY * key) { bool res = true; @@ -250,6 +248,7 @@ bool WritePrivateKey(const char * fileName, EVP_PKEY * key, KeyFormat keyFmt) uint32_t chipKeyBase64Len = BASE64_ENCODED_LEN(chipKeyLen); std::unique_ptr chipKey(new uint8_t[chipKeyLen]); std::unique_ptr chipKeyBase64(new uint8_t[chipKeyBase64Len]); + P256SerializedKeypair serializedKeypair; VerifyOrExit(key != nullptr, res = false); @@ -278,12 +277,13 @@ bool WritePrivateKey(const char * fileName, EVP_PKEY * key, KeyFormat keyFmt) break; case kKeyFormat_Chip_Raw: case kKeyFormat_Chip_Base64: - res = SerializeKeyPair(key, chipKey.get(), chipKeyLen, chipKeyLen); + res = SerializeKeyPair(key, serializedKeypair); VerifyTrueOrExit(res); if (keyFmt == kKeyFormat_Chip_Base64) { - res = Base64Encode(chipKey.get(), chipKeyLen, chipKeyBase64.get(), chipKeyBase64Len, chipKeyBase64Len); + res = Base64Encode(serializedKeypair, static_cast(serializedKeypair.Length()), chipKeyBase64.get(), + chipKeyBase64Len, chipKeyBase64Len); VerifyTrueOrExit(res); keyToWrite = chipKeyBase64.get(); diff --git a/src/tools/chip-cert/chip-cert.cpp b/src/tools/chip-cert/chip-cert.cpp index 9d25369b728794..91a90273d249b5 100644 --- a/src/tools/chip-cert/chip-cert.cpp +++ b/src/tools/chip-cert/chip-cert.cpp @@ -58,6 +58,10 @@ const char * const sHelp = "\n" " print-cert -- Print a CHIP certificate.\n" "\n" + " gen-att-cert -- Generate a CHIP attestation certificate.\n" + "\n" + " gen-cd -- Generate a CHIP certification declaration signed message.\n" + "\n" " version -- Print the program version and exit.\n" "\n"; // clang-format on @@ -123,6 +127,10 @@ extern "C" int main(int argc, char * argv[]) { res = Cmd_GenAttCert(argc - 1, argv + 1); } + else if (strcasecmp(argv[1], "gen-cd") == 0 || strcasecmp(argv[1], "gencd") == 0) + { + res = Cmd_GenCD(argc - 1, argv + 1); + } else { fprintf(stderr, "Unrecognized command: %s\n", argv[1]); diff --git a/src/tools/chip-cert/chip-cert.h b/src/tools/chip-cert/chip-cert.h index 77c2042f3ed6d3..66e395993e539e 100644 --- a/src/tools/chip-cert/chip-cert.h +++ b/src/tools/chip-cert/chip-cert.h @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -117,6 +118,7 @@ class ToolChipDN : public chip::Credentials::ChipDN void PrintDN(FILE * file, const char * name) const; }; +extern bool Cmd_GenCD(int argc, char * argv[]); extern bool Cmd_GenCert(int argc, char * argv[]); extern bool Cmd_ConvertCert(int argc, char * argv[]); extern bool Cmd_ConvertKey(int argc, char * argv[]); @@ -143,6 +145,7 @@ extern bool MakeAttCert(AttCertType attCertType, const char * subjectCN, uint16_ extern bool GenerateKeyPair(EVP_PKEY * key); extern bool ReadKey(const char * fileName, EVP_PKEY * key); extern bool WritePrivateKey(const char * fileName, EVP_PKEY * key, KeyFormat keyFmt); +extern bool SerializeKeyPair(EVP_PKEY * key, chip::Crypto::P256SerializedKeypair & serializedKeypair); extern bool X509ToChipCert(X509 * cert, chip::MutableByteSpan & chipCert); @@ -151,7 +154,6 @@ extern bool Base64Encode(const uint8_t * inData, uint32_t inDataLen, uint8_t * o extern bool Base64Decode(const uint8_t * inData, uint32_t inDataLen, uint8_t * outBuf, uint32_t outBufSize, uint32_t & outDataLen); extern bool IsBase64String(const char * str, uint32_t strLen); extern bool ContainsPEMMarker(const char * marker, const uint8_t * data, uint32_t dataLen); -extern bool ParseChip64bitAttr(const char * str, uint64_t & val); extern bool ParseDateTime(const char * str, struct tm & date); extern bool ReadFileIntoMem(const char * fileName, uint8_t * data, uint32_t & dataLen); extern bool OpenFile(const char * fileName, FILE *& file, bool toWrite = false); diff --git a/src/transport/FabricTable.h b/src/transport/FabricTable.h index 47a4ec3fce353d..face499507387f 100644 --- a/src/transport/FabricTable.h +++ b/src/transport/FabricTable.h @@ -29,6 +29,7 @@ #include #endif #include +#include #include #include #include @@ -110,6 +111,7 @@ class DLL_EXPORT FabricInfo // TODO - Optimize persistent storage of NOC and Root Cert in FabricInfo. CHIP_ERROR SetRootCert(const chip::ByteSpan & cert) { return SetCert(mRootCert, cert); } CHIP_ERROR SetICACert(const chip::ByteSpan & cert) { return SetCert(mICACert, cert); } + CHIP_ERROR SetICACert(const Optional & cert) { return SetICACert(cert.ValueOr(ByteSpan())); } CHIP_ERROR SetNOCCert(const chip::ByteSpan & cert) { return SetCert(mNOCCert, cert); } bool IsInitialized() const { return IsOperationalNodeId(mOperationalId.GetNodeId()); } diff --git a/src/transport/PairingSession.h b/src/transport/PairingSession.h index 801297f13354a4..cf99a76f719492 100644 --- a/src/transport/PairingSession.h +++ b/src/transport/PairingSession.h @@ -88,6 +88,22 @@ class DLL_EXPORT PairingSession virtual const char * GetR2ISessionInfo() const = 0; protected: + // TODO - Move EstimateTLVStructOverhead to CHIPTLV header file + static constexpr size_t EstimateTLVStructOverhead() + { + // The struct itself has a control byte and an end-of-struct marker. + return 2; + } + + template + static constexpr size_t EstimateTLVStructOverhead(size_t firstFieldSize, FieldSizes... otherFields) + { + // Estimate 4 bytes of overhead per field. This can happen for a large + // octet string field: 1 byte control, 1 byte context tag, 2 bytes + // length. + return firstFieldSize + 4 + EstimateTLVStructOverhead(otherFields...); + } + void SetPeerNodeId(NodeId peerNodeId) { mPeerNodeId = peerNodeId; } void SetPeerSessionId(uint16_t id) { mPeerSessionId.SetValue(id); } void SetLocalSessionId(uint16_t id) { mLocalSessionId = id; } diff --git a/src/transport/SecureSessionTable.h b/src/transport/SecureSessionTable.h index 4bc1eea9042a4d..00b126b5fb5765 100644 --- a/src/transport/SecureSessionTable.h +++ b/src/transport/SecureSessionTable.h @@ -30,73 +30,31 @@ namespace Transport { constexpr const uint16_t kAnyKeyId = 0xffff; /** - * Handles a set of peer connection states. + * Handles a set of sessions. * * Intended for: - * - handle connection active time and expiration - * - allocate and free space for connection states. + * - handle session active time and expiration + * - allocate and free space for sessions. */ -template +template class SecureSessionTable { public: /** - * Allocates a new peer connection state state object out of the internal resource pool. + * Allocates a new secure session out of the internal resource pool. * - * @param address represents the connection state address - * @param state [out] will contain the connection state if one was available. May be null if no return value is desired. - * - * @note the newly created state will have an 'active' time set based on the current time source. - * - * @returns CHIP_NO_ERROR if state could be initialized. May fail if maximum connection count - * has been reached (with CHIP_ERROR_NO_MEMORY). - */ - CHECK_RETURN_VALUE - CHIP_ERROR CreateNewPeerConnectionState(const PeerAddress & address, SecureSession ** state) - { - CHIP_ERROR err = CHIP_ERROR_NO_MEMORY; - - if (state) - { - *state = nullptr; - } - - for (size_t i = 0; i < kMaxConnectionCount; i++) - { - if (!mStates[i].IsInitialized()) - { - mStates[i] = SecureSession(address); - mStates[i].SetLastActivityTimeMs(mTimeSource.GetCurrentMonotonicTimeMs()); - - if (state) - { - *state = &mStates[i]; - } - - err = CHIP_NO_ERROR; - break; - } - } - - return err; - } - - /** - * Allocates a new peer connection state state object out of the internal resource pool. - * - * @param peerNode represents optional peer Node's ID + * @param peerNode represents peer Node's ID * @param peerSessionId represents the encryption key ID assigned by peer node * @param localSessionId represents the encryption key ID assigned by local node - * @param state [out] will contain the connection state if one was available. May be null if no return value is desired. + * @param state [out] will contain the session if one was available. May be null if no return value is desired. * * @note the newly created state will have an 'active' time set based on the current time source. * - * @returns CHIP_NO_ERROR if state could be initialized. May fail if maximum connection count + * @returns CHIP_NO_ERROR if state could be initialized. May fail if maximum session count * has been reached (with CHIP_ERROR_NO_MEMORY). */ CHECK_RETURN_VALUE - CHIP_ERROR CreateNewPeerConnectionState(const Optional & peerNode, uint16_t peerSessionId, uint16_t localSessionId, - SecureSession ** state) + CHIP_ERROR CreateNewSecureSession(NodeId peerNode, uint16_t peerSessionId, uint16_t localSessionId, SecureSession ** state) { CHIP_ERROR err = CHIP_ERROR_NO_MEMORY; @@ -105,20 +63,16 @@ class SecureSessionTable *state = nullptr; } - for (size_t i = 0; i < kMaxConnectionCount; i++) + for (size_t i = 0; i < kMaxSessionCount; i++) { if (!mStates[i].IsInitialized()) { mStates[i] = SecureSession(); + mStates[i].SetPeerNodeId(peerNode); mStates[i].SetPeerSessionId(peerSessionId); mStates[i].SetLocalSessionId(localSessionId); mStates[i].SetLastActivityTimeMs(mTimeSource.GetCurrentMonotonicTimeMs()); - if (peerNode.ValueOr(kUndefinedNodeId) != kUndefinedNodeId) - { - mStates[i].SetPeerNodeId(peerNode.Value()); - } - if (state) { *state = &mStates[i]; @@ -133,56 +87,25 @@ class SecureSessionTable } /** - * Get a peer connection state given a Peer address. + * Get a secure session given a Node Id. * - * @param address is the connection to find (based on address) + * @param nodeId is the session to find (based on nodeId). * @param begin If a member of the pool, will start search from the next item. Can be nullptr to search from start. * * @return the state found, nullptr if not found */ CHECK_RETURN_VALUE - SecureSession * FindPeerConnectionState(const PeerAddress & address, SecureSession * begin) + SecureSession * FindSecureSession(NodeId nodeId, SecureSession * begin) { SecureSession * state = nullptr; SecureSession * iter = &mStates[0]; - if (begin >= iter && begin < &mStates[kMaxConnectionCount]) + if (begin >= iter && begin < &mStates[kMaxSessionCount]) { iter = begin + 1; } - for (; iter < &mStates[kMaxConnectionCount]; iter++) - { - if (iter->GetPeerAddress() == address) - { - state = iter; - break; - } - } - return state; - } - - /** - * Get a peer connection state given a Node Id. - * - * @param nodeId is the connection to find (based on nodeId). Note that initial connections - * do not have a node id set. Use this if you know the node id should be set. - * @param begin If a member of the pool, will start search from the next item. Can be nullptr to search from start. - * - * @return the state found, nullptr if not found - */ - CHECK_RETURN_VALUE - SecureSession * FindPeerConnectionState(NodeId nodeId, SecureSession * begin) - { - SecureSession * state = nullptr; - SecureSession * iter = &mStates[0]; - - if (begin >= iter && begin < &mStates[kMaxConnectionCount]) - { - iter = begin + 1; - } - - for (; iter < &mStates[kMaxConnectionCount]; iter++) + for (; iter < &mStates[kMaxSessionCount]; iter++) { if (!iter->IsInitialized()) { @@ -198,104 +121,25 @@ class SecureSessionTable } /** - * Get a peer connection state given a Node Id and Peer's Encryption Key Id. - * - * @param nodeId is the connection to find (based on nodeId). Note that initial connections - * do not have a node id set. Use this if you know the node id should be set. - * @param peerSessionId Encryption key ID used by the peer node. - * @param begin If a member of the pool, will start search from the next item. Can be nullptr to search from start. + * Get a secure session given a Node Id and Peer's Encryption Key Id. * - * @return the state found, nullptr if not found - */ - CHECK_RETURN_VALUE - SecureSession * FindPeerConnectionState(Optional nodeId, uint16_t peerSessionId, SecureSession * begin) - { - SecureSession * state = nullptr; - SecureSession * iter = &mStates[0]; - - if (begin >= iter && begin < &mStates[kMaxConnectionCount]) - { - iter = begin + 1; - } - - for (; iter < &mStates[kMaxConnectionCount]; iter++) - { - if (!iter->IsInitialized()) - { - continue; - } - if (peerSessionId == kAnyKeyId || iter->GetPeerSessionId() == peerSessionId) - { - if (nodeId.ValueOr(kUndefinedNodeId) == kUndefinedNodeId || iter->GetPeerNodeId() == kUndefinedNodeId || - iter->GetPeerNodeId() == nodeId.Value()) - { - state = iter; - break; - } - } - } - return state; - } - - /** - * Get a peer connection state given the local Encryption Key Id. - * - * @param keyId Encryption key ID assigned by the local node. - * @param begin If a member of the pool, will start search from the next item. Can be nullptr to search from start. - * - * @return the state found, nullptr if not found - */ - CHECK_RETURN_VALUE - SecureSession * FindPeerConnectionState(uint16_t keyId, SecureSession * begin) - { - SecureSession * state = nullptr; - SecureSession * iter = &mStates[0]; - - VerifyOrDie(begin == nullptr || (begin >= iter && begin < &mStates[kMaxConnectionCount])); - - if (begin != nullptr) - { - iter = begin + 1; - } - - for (; iter < &mStates[kMaxConnectionCount]; iter++) - { - if (!iter->IsInitialized()) - { - continue; - } - - if (iter->GetLocalSessionId() == keyId) - { - state = iter; - break; - } - } - return state; - } - - /** - * Get a peer connection state given a Node Id and Peer's Encryption Key Id. - * - * @param nodeId is the connection to find (based on peer nodeId). Note that initial connections - * do not have a node id set. Use this if you know the node id should be set. * @param localSessionId Encryption key ID used by the local node. * @param begin If a member of the pool, will start search from the next item. Can be nullptr to search from start. * * @return the state found, nullptr if not found */ CHECK_RETURN_VALUE - SecureSession * FindPeerConnectionStateByLocalKey(Optional nodeId, uint16_t localSessionId, SecureSession * begin) + SecureSession * FindSecureSessionByLocalKey(uint16_t localSessionId, SecureSession * begin) { SecureSession * state = nullptr; SecureSession * iter = &mStates[0]; - if (begin >= iter && begin < &mStates[kMaxConnectionCount]) + if (begin >= iter && begin < &mStates[kMaxSessionCount]) { iter = begin + 1; } - for (; iter < &mStates[kMaxConnectionCount]; iter++) + for (; iter < &mStates[kMaxSessionCount]; iter++) { if (!iter->IsInitialized()) { @@ -303,26 +147,22 @@ class SecureSessionTable } if (iter->GetLocalSessionId() == localSessionId) { - if (nodeId.ValueOr(kUndefinedNodeId) == kUndefinedNodeId || iter->GetPeerNodeId() == kUndefinedNodeId || - iter->GetPeerNodeId() == nodeId.Value()) - { - state = iter; - break; - } + state = iter; + break; } } return state; } /** - * Get the first peer connection state that matches the given fabric index. + * Get the first session that matches the given fabric index. * * @param fabric The fabric index to match * - * @return the state found, nullptr if not found + * @return the session found, nullptr if not found */ CHECK_RETURN_VALUE - SecureSession * FindPeerConnectionStateByFabric(FabricIndex fabric) + SecureSession * FindSecureSessionByFabric(FabricIndex fabric) { for (auto & state : mStates) { @@ -338,51 +178,51 @@ class SecureSessionTable return nullptr; } - /// Convenience method to mark a peer connection state as active - void MarkConnectionActive(SecureSession * state) { state->SetLastActivityTimeMs(mTimeSource.GetCurrentMonotonicTimeMs()); } + /// Convenience method to mark a session as active + void MarkSessionActive(SecureSession * state) { state->SetLastActivityTimeMs(mTimeSource.GetCurrentMonotonicTimeMs()); } - /// Convenience method to expired a peer connection state and fired the related callback + /// Convenience method to expired a session and fired the related callback template - void MarkConnectionExpired(SecureSession * state, Callback callback) + void MarkSessionExpired(SecureSession * state, Callback callback) { callback(*state); *state = SecureSession(PeerAddress::Uninitialized()); } /** - * Iterates through all active connections and expires any connection with an idle time + * Iterates through all active sessions and expires any sessions with an idle time * larger than the given amount. * - * Expiring a connection involves callback execution and then clearing the internal state. + * Expiring a session involves callback execution and then clearing the internal state. */ template - void ExpireInactiveConnections(uint64_t maxIdleTimeMs, Callback callback) + void ExpireInactiveSessions(uint64_t maxIdleTimeMs, Callback callback) { const uint64_t currentTime = mTimeSource.GetCurrentMonotonicTimeMs(); - for (size_t i = 0; i < kMaxConnectionCount; i++) + for (size_t i = 0; i < kMaxSessionCount; i++) { - if (!mStates[i].GetPeerAddress().IsInitialized()) + if (!mStates[i].IsInitialized()) { - continue; // not an active connection + continue; // not an active session } - uint64_t connectionActiveTime = mStates[i].GetLastActivityTimeMs(); - if (connectionActiveTime + maxIdleTimeMs >= currentTime) + uint64_t sessionActiveTime = mStates[i].GetLastActivityTimeMs(); + if (sessionActiveTime + maxIdleTimeMs >= currentTime) { continue; // not expired } - MarkConnectionExpired(&mStates[i], callback); + MarkSessionExpired(&mStates[i], callback); } } - /// Allows access to the underlying time source used for keeping track of connection active time + /// Allows access to the underlying time source used for keeping track of session active time Time::TimeSource & GetTimeSource() { return mTimeSource; } private: Time::TimeSource mTimeSource; - SecureSession mStates[kMaxConnectionCount]; + SecureSession mStates[kMaxSessionCount]; }; } // namespace Transport diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index 0fccd619a16e87..fb6508c0c30d32 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -176,7 +177,7 @@ CHIP_ERROR SessionManager::SendPreparedMessage(SessionHandle session, const Encr } // This marks any connection where we send data to as 'active' - mPeerConnections.MarkConnectionActive(state); + mPeerConnections.MarkSessionActive(state); destination = &state->GetPeerAddress(); @@ -184,7 +185,7 @@ CHIP_ERROR SessionManager::SendPreparedMessage(SessionHandle session, const Encr "Sending %s msg %p with MessageCounter:" ChipLogFormatMessageCounter " to 0x" ChipLogFormatX64 " at monotonic time: %" PRId64 " msec", "encrypted", &preparedMessage, preparedMessage.GetMessageCounter(), ChipLogValueX64(state->GetPeerNodeId()), - System::SystemClock().GetMonotonicMilliseconds()); + System::SystemClock().GetMonotonicMilliseconds64().count()); } else { @@ -196,7 +197,7 @@ CHIP_ERROR SessionManager::SendPreparedMessage(SessionHandle session, const Encr "Sending %s msg %p with MessageCounter:" ChipLogFormatMessageCounter " to 0x" ChipLogFormatX64 " at monotonic time: %" PRId64 " msec", "plaintext", &preparedMessage, preparedMessage.GetMessageCounter(), ChipLogValueX64(kUndefinedNodeId), - System::SystemClock().GetMonotonicMilliseconds()); + System::SystemClock().GetMonotonicMilliseconds64().count()); } PacketBufferHandle msgBuf = preparedMessage.CastToWritable(); @@ -219,25 +220,25 @@ void SessionManager::ExpirePairing(SessionHandle session) SecureSession * state = GetSecureSession(session); if (state != nullptr) { - mPeerConnections.MarkConnectionExpired( - state, [this](const Transport::SecureSession & state1) { HandleConnectionExpired(state1); }); + mPeerConnections.MarkSessionExpired(state, + [this](const Transport::SecureSession & state1) { HandleConnectionExpired(state1); }); } } void SessionManager::ExpireAllPairings(NodeId peerNodeId, FabricIndex fabric) { - SecureSession * state = mPeerConnections.FindPeerConnectionState(peerNodeId, nullptr); + SecureSession * state = mPeerConnections.FindSecureSession(peerNodeId, nullptr); while (state != nullptr) { if (fabric == state->GetFabricIndex()) { - mPeerConnections.MarkConnectionExpired( + mPeerConnections.MarkSessionExpired( state, [this](const Transport::SecureSession & state1) { HandleConnectionExpired(state1); }); - state = mPeerConnections.FindPeerConnectionState(peerNodeId, nullptr); + state = mPeerConnections.FindSecureSession(peerNodeId, nullptr); } else { - state = mPeerConnections.FindPeerConnectionState(peerNodeId, state); + state = mPeerConnections.FindSecureSession(peerNodeId, state); } } } @@ -245,12 +246,12 @@ void SessionManager::ExpireAllPairings(NodeId peerNodeId, FabricIndex fabric) void SessionManager::ExpireAllPairingsForFabric(FabricIndex fabric) { ChipLogDetail(Inet, "Expiring all connections for fabric %d!!", fabric); - SecureSession * state = mPeerConnections.FindPeerConnectionStateByFabric(fabric); + SecureSession * state = mPeerConnections.FindSecureSessionByFabric(fabric); while (state != nullptr) { - mPeerConnections.MarkConnectionExpired( - state, [this](const Transport::SecureSession & state1) { HandleConnectionExpired(state1); }); - state = mPeerConnections.FindPeerConnectionStateByFabric(fabric); + mPeerConnections.MarkSessionExpired(state, + [this](const Transport::SecureSession & state1) { HandleConnectionExpired(state1); }); + state = mPeerConnections.FindSecureSessionByFabric(fabric); } } @@ -259,21 +260,19 @@ CHIP_ERROR SessionManager::NewPairing(const Optional & p { uint16_t peerSessionId = pairing->GetPeerSessionId(); uint16_t localSessionId = pairing->GetLocalSessionId(); - SecureSession * state = - mPeerConnections.FindPeerConnectionStateByLocalKey(Optional::Value(peerNodeId), localSessionId, nullptr); + SecureSession * state = mPeerConnections.FindSecureSessionByLocalKey(localSessionId, nullptr); // Find any existing connection with the same local key ID if (state) { - mPeerConnections.MarkConnectionExpired( - state, [this](const Transport::SecureSession & state1) { HandleConnectionExpired(state1); }); + mPeerConnections.MarkSessionExpired(state, + [this](const Transport::SecureSession & state1) { HandleConnectionExpired(state1); }); } ChipLogDetail(Inet, "New secure session created for device 0x" ChipLogFormatX64 ", key %d!!", ChipLogValueX64(peerNodeId), peerSessionId); state = nullptr; - ReturnErrorOnFailure( - mPeerConnections.CreateNewPeerConnectionState(Optional::Value(peerNodeId), peerSessionId, localSessionId, &state)); + ReturnErrorOnFailure(mPeerConnections.CreateNewSecureSession(peerNodeId, peerSessionId, localSessionId, &state)); ReturnErrorCodeIf(state == nullptr, CHIP_ERROR_NO_MEMORY); state->SetFabricIndex(fabric); @@ -328,7 +327,14 @@ void SessionManager::OnMessageReceived(const PeerAddress & peerAddress, System:: if (packetHeader.IsEncrypted()) { - SecureMessageDispatch(packetHeader, peerAddress, std::move(msg)); + if (packetHeader.IsGroupSession()) + { + SecureGroupMessageDispatch(packetHeader, peerAddress, std::move(msg)); + } + else + { + SecureUnicastMessageDispatch(packetHeader, peerAddress, std::move(msg)); + } } else { @@ -379,12 +385,12 @@ void SessionManager::MessageDispatch(const PacketHeader & packetHeader, const Tr } } -void SessionManager::SecureMessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, - System::PacketBufferHandle && msg) +void SessionManager::SecureUnicastMessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, + System::PacketBufferHandle && msg) { CHIP_ERROR err = CHIP_NO_ERROR; - SecureSession * state = mPeerConnections.FindPeerConnectionState(packetHeader.GetSessionId(), nullptr); + SecureSession * state = mPeerConnections.FindSecureSessionByLocalKey(packetHeader.GetSessionId(), nullptr); PayloadHeader payloadHeader; @@ -446,7 +452,7 @@ void SessionManager::SecureMessageDispatch(const PacketHeader & packetHeader, co SuccessOrExit(err); } - mPeerConnections.MarkConnectionActive(state); + mPeerConnections.MarkSessionActive(state); if (isDuplicate == SessionManagerDelegate::DuplicateMessage::Yes && !payloadHeader.NeedsAck()) { @@ -493,6 +499,61 @@ void SessionManager::SecureMessageDispatch(const PacketHeader & packetHeader, co } } +void SessionManager::SecureGroupMessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, + System::PacketBufferHandle && msg) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + PayloadHeader payloadHeader; + SessionManagerDelegate::DuplicateMessage isDuplicate = SessionManagerDelegate::DuplicateMessage::No; + // Credentials::GroupDataProvider * groups = Credentials::GetGroupDataProvider(); + + VerifyOrExit(!msg.IsNull(), ChipLogError(Inet, "Secure transport received NULL packet, discarding")); + + // TODO: Handle Group message counter here spec 4.7.3 + // spec 4.5.1.2 for msg counter + + // Trial decryption with GroupDataProvider. TODO: Implement the GroupDataProvider Class + // VerifyOrExit(CHIP_NO_ERROR == groups->DecryptMessage(packetHeader, payloadHeader, msg), + // ChipLogError(Inet, "Secure transport received group message, but failed to decode it, discarding")); + + if (isDuplicate == SessionManagerDelegate::DuplicateMessage::Yes && !payloadHeader.NeedsAck()) + { + ChipLogDetail(Inet, + "Received a duplicate message with MessageCounter:" ChipLogFormatMessageCounter + " on exchange " ChipLogFormatExchangeId, + packetHeader.GetMessageCounter(), ChipLogValueExchangeIdFromSentHeader(payloadHeader)); + if (!payloadHeader.NeedsAck()) + { + // If it's a duplicate message, but doesn't require an ack, let's drop it right here to save CPU + // cycles on further message processing. + ExitNow(err = CHIP_NO_ERROR); + } + } + + if (packetHeader.IsSecureSessionControlMsg()) + { + // TODO: control message counter is not implemented yet + } + else + { + // TODO: Commit Group Message Counter + } + + if (mCB != nullptr) + { + // TODO: Update Session Handle for Group messages. + // SessionHandle session(state->GetPeerNodeId(), state->GetLocalSessionId(), state->GetPeerSessionId(), + // state->GetFabricIndex()); + // mCB->OnMessageReceived(packetHeader, payloadHeader, nullptr, peerAddress, isDuplicate, std::move(msg)); + } + +exit: + if (err != CHIP_NO_ERROR && mCB != nullptr) + { + mCB->OnReceiveError(err, peerAddress); + } +} + void SessionManager::HandleConnectionExpired(const Transport::SecureSession & state) { ChipLogDetail(Inet, "Marking old secure session for device 0x" ChipLogFormatX64 " as expired", @@ -513,7 +574,7 @@ void SessionManager::ExpiryTimerCallback(System::Layer * layer, void * param) #if CHIP_CONFIG_SESSION_REKEYING // TODO(#2279): session expiration is currently disabled until rekeying is supported // the #ifdef should be removed after that. - mgr->mPeerConnections.ExpireInactiveConnections( + mgr->mPeerConnections.ExpireInactiveSessions( CHIP_PEER_CONNECTION_TIMEOUT_MS, [this](const Transport::SecureSession & state1) { HandleConnectionExpired(state1); }); #endif mgr->ScheduleExpiryTimer(); // re-schedule the oneshot timer @@ -521,8 +582,14 @@ void SessionManager::ExpiryTimerCallback(System::Layer * layer, void * param) SecureSession * SessionManager::GetSecureSession(SessionHandle session) { - return mPeerConnections.FindPeerConnectionStateByLocalKey(Optional::Value(session.mPeerNodeId), - session.mLocalSessionId.ValueOr(0), nullptr); + if (session.mLocalSessionId.HasValue()) + { + return mPeerConnections.FindSecureSessionByLocalKey(session.mLocalSessionId.Value(), nullptr); + } + else + { + return nullptr; + } } } // namespace chip diff --git a/src/transport/SessionManager.h b/src/transport/SessionManager.h index 43f6e0adbf1a12..d0d3795b41858a 100644 --- a/src/transport/SessionManager.h +++ b/src/transport/SessionManager.h @@ -313,8 +313,12 @@ class DLL_EXPORT SessionManager : public TransportMgrDelegate */ static void ExpiryTimerCallback(System::Layer * layer, void * param); - void SecureMessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, - System::PacketBufferHandle && msg); + void SecureUnicastMessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, + System::PacketBufferHandle && msg); + + void SecureGroupMessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, + System::PacketBufferHandle && msg); + void MessageDispatch(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, System::PacketBufferHandle && msg); diff --git a/src/transport/UnauthenticatedSessionTable.h b/src/transport/UnauthenticatedSessionTable.h index 70b46f26bf56b2..eb063494e0dc05 100644 --- a/src/transport/UnauthenticatedSessionTable.h +++ b/src/transport/UnauthenticatedSessionTable.h @@ -78,7 +78,7 @@ class UnauthenticatedSession : public ReferenceCounted +template class UnauthenticatedSessionTable { public: @@ -111,14 +111,14 @@ class UnauthenticatedSessionTable session->SetLastActivityTimeMs(mTimeSource.GetCurrentMonotonicTimeMs()); } - /// Allows access to the underlying time source used for keeping track of connection active time + /// Allows access to the underlying time source used for keeping track of session active time Time::TimeSource & GetTimeSource() { return mTimeSource; } private: /** * Allocates a new session out of the internal resource pool. * - * @returns CHIP_NO_ERROR if new session created. May fail if maximum connection count has been reached (with + * @returns CHIP_NO_ERROR if new session created. May fail if maximum session count has been reached (with * CHIP_ERROR_NO_MEMORY). */ CHECK_RETURN_VALUE @@ -198,7 +198,7 @@ class UnauthenticatedSessionTable } Time::TimeSource mTimeSource; - BitMapObjectPool mEntries; + BitMapObjectPool mEntries; }; } // namespace Transport diff --git a/src/transport/raw/MessageHeader.cpp b/src/transport/raw/MessageHeader.cpp index d9ac45a38a2e1a..a2b55235dc0012 100644 --- a/src/transport/raw/MessageHeader.cpp +++ b/src/transport/raw/MessageHeader.cpp @@ -87,9 +87,6 @@ constexpr uint8_t kMsgFlagsMask = 0x07; /// Shift to convert to/from a masked version 8bit value to a 4bit version. constexpr int kVersionShift = 4; -// Mask to extract sessionType -constexpr uint8_t kSessionTypeMask = 0x03; - } // namespace uint16_t PacketHeader::EncodeSizeBytes() const @@ -143,31 +140,23 @@ CHIP_ERROR PacketHeader::Decode(const uint8_t * const data, uint16_t size, uint1 uint16_t octets_read; uint8_t msgFlags; - err = reader.Read8(&msgFlags).StatusCode(); - SuccessOrExit(err); + SuccessOrExit(err = reader.Read8(&msgFlags).StatusCode()); version = ((msgFlags & kVersionMask) >> kVersionShift); VerifyOrExit(version == kMsgHeaderVersion, err = CHIP_ERROR_VERSION_MISMATCH); - - mMsgFlags.SetRaw(msgFlags); + SetMessageFlags(msgFlags); uint8_t securityFlags; - err = reader.Read8(&securityFlags).StatusCode(); - SuccessOrExit(err); - mSecFlags.SetRaw(securityFlags); - - mSessionType = static_cast(securityFlags & kSessionTypeMask); + SuccessOrExit(err = reader.Read8(&securityFlags).StatusCode()); + SetSecurityFlags(securityFlags); - err = reader.Read16(&mSessionId).StatusCode(); - SuccessOrExit(err); + SuccessOrExit(err = reader.Read16(&mSessionId).StatusCode()); - err = reader.Read32(&mMessageCounter).StatusCode(); - SuccessOrExit(err); + SuccessOrExit(err = reader.Read32(&mMessageCounter).StatusCode()); if (mMsgFlags.Has(Header::MsgFlagValues::kSourceNodeIdPresent)) { uint64_t sourceNodeId; - err = reader.Read64(&sourceNodeId).StatusCode(); - SuccessOrExit(err); + SuccessOrExit(err = reader.Read64(&sourceNodeId).StatusCode()); mSourceNodeId.SetValue(sourceNodeId); } else @@ -178,26 +167,22 @@ CHIP_ERROR PacketHeader::Decode(const uint8_t * const data, uint16_t size, uint1 if (!IsSessionTypeValid()) { // Reserved. - err = CHIP_ERROR_INTERNAL; - SuccessOrExit(err); + SuccessOrExit(err = CHIP_ERROR_INTERNAL); } if (mMsgFlags.HasAll(Header::MsgFlagValues::kDestinationNodeIdPresent, Header::MsgFlagValues::kDestinationGroupIdPresent)) { // Reserved. - err = CHIP_ERROR_INTERNAL; - SuccessOrExit(err); + SuccessOrExit(err = CHIP_ERROR_INTERNAL); } else if (mMsgFlags.Has(Header::MsgFlagValues::kDestinationNodeIdPresent)) { if (mSessionType != Header::SessionType::kUnicastSession) { - err = CHIP_ERROR_INTERNAL; - SuccessOrExit(err); + SuccessOrExit(err = CHIP_ERROR_INTERNAL); } uint64_t destinationNodeId; - err = reader.Read64(&destinationNodeId).StatusCode(); - SuccessOrExit(err); + SuccessOrExit(err = reader.Read64(&destinationNodeId).StatusCode()); mDestinationNodeId.SetValue(destinationNodeId); mDestinationGroupId.ClearValue(); } @@ -205,12 +190,10 @@ CHIP_ERROR PacketHeader::Decode(const uint8_t * const data, uint16_t size, uint1 { if (mSessionType != Header::SessionType::kGroupSession) { - err = CHIP_ERROR_INTERNAL; - SuccessOrExit(err); + SuccessOrExit(err = CHIP_ERROR_INTERNAL); } uint16_t destinationGroupId; - err = reader.Read16(&destinationGroupId).StatusCode(); - SuccessOrExit(err); + SuccessOrExit(err = reader.Read16(&destinationGroupId).StatusCode()); mDestinationGroupId.SetValue(destinationGroupId); mDestinationNodeId.ClearValue(); } @@ -244,8 +227,7 @@ CHIP_ERROR PayloadHeader::Decode(const uint8_t * const data, uint16_t size, uint uint8_t header; uint16_t octets_read; - err = reader.Read8(&header).Read8(&mMessageType).Read16(&mExchangeID).StatusCode(); - SuccessOrExit(err); + SuccessOrExit(err = reader.Read8(&header).Read8(&mMessageType).Read16(&mExchangeID).StatusCode()); mExchangeFlags.SetRaw(header); @@ -253,8 +235,7 @@ CHIP_ERROR PayloadHeader::Decode(const uint8_t * const data, uint16_t size, uint if (HaveVendorId()) { uint16_t vendor_id_raw; - err = reader.Read16(&vendor_id_raw).StatusCode(); - SuccessOrExit(err); + SuccessOrExit(err = reader.Read16(&vendor_id_raw).StatusCode()); vendor_id = static_cast(vendor_id_raw); } else @@ -263,16 +244,14 @@ CHIP_ERROR PayloadHeader::Decode(const uint8_t * const data, uint16_t size, uint } uint16_t protocol_id; - err = reader.Read16(&protocol_id).StatusCode(); - SuccessOrExit(err); + SuccessOrExit(err = reader.Read16(&protocol_id).StatusCode()); mProtocolID = Protocols::Id(vendor_id, protocol_id); if (mExchangeFlags.Has(Header::ExFlagValues::kExchangeFlag_AckMsg)) { uint32_t ack_message_counter; - err = reader.Read32(&ack_message_counter).StatusCode(); - SuccessOrExit(err); + SuccessOrExit(err = reader.Read32(&ack_message_counter).StatusCode()); mAckMessageCounter.SetValue(ack_message_counter); } else diff --git a/src/transport/raw/MessageHeader.h b/src/transport/raw/MessageHeader.h index e3b52a75a7db02..a3149204a62bea 100644 --- a/src/transport/raw/MessageHeader.h +++ b/src/transport/raw/MessageHeader.h @@ -110,6 +110,11 @@ enum class SecFlagValues : uint8_t kMsgExtensionFlag = 0b00100000, }; +enum SecFlagMask +{ + kSessionTypeMask = 0b00000011, ///< Mask to extract sessionType +}; + using MsgFlags = BitFlags; using SecFlags = BitFlags; @@ -164,7 +169,11 @@ class PacketHeader void SetMessageFlags(uint8_t flags) { mMsgFlags.SetRaw(flags); } - void SetSecurityFlags(uint8_t flags) { mSecFlags.SetRaw(flags); } + void SetSecurityFlags(uint8_t securityFlags) + { + mSecFlags.SetRaw(securityFlags); + mSessionType = static_cast(securityFlags & Header::SecFlagMask::kSessionTypeMask); + } bool IsGroupSession() const { return mSessionType == Header::SessionType::kGroupSession; } bool IsUnicastSession() const { return mSessionType == Header::SessionType::kUnicastSession; } diff --git a/src/transport/raw/PeerAddress.h b/src/transport/raw/PeerAddress.h index b730c33ebd5fc7..60fbec725d0bbd 100644 --- a/src/transport/raw/PeerAddress.h +++ b/src/transport/raw/PeerAddress.h @@ -61,9 +61,8 @@ enum class Type : uint8_t class PeerAddress { public: - PeerAddress() : mIPAddress(Inet::IPAddress::Any), mTransportType(Type::kUndefined), mInterface(INET_NULL_INTERFACEID) {} - PeerAddress(const Inet::IPAddress & addr, Type type) : mIPAddress(addr), mTransportType(type), mInterface(INET_NULL_INTERFACEID) - {} + PeerAddress() : mIPAddress(Inet::IPAddress::Any), mTransportType(Type::kUndefined) {} + PeerAddress(const Inet::IPAddress & addr, Type type) : mIPAddress(addr), mTransportType(type) {} PeerAddress(Type type) : mTransportType(type) {} PeerAddress(PeerAddress &&) = default; @@ -179,7 +178,7 @@ class PeerAddress Inet::IPAddress mIPAddress = {}; Type mTransportType = Type::kUndefined; uint16_t mPort = CHIP_PORT; ///< Relevant for UDP data sending. - Inet::InterfaceId mInterface = INET_NULL_INTERFACEID; + Inet::InterfaceId mInterface = Inet::InterfaceId::Null(); }; } // namespace Transport diff --git a/src/transport/raw/TCP.cpp b/src/transport/raw/TCP.cpp index 3789e73242f0f8..4319b871811f1e 100644 --- a/src/transport/raw/TCP.cpp +++ b/src/transport/raw/TCP.cpp @@ -91,7 +91,8 @@ CHIP_ERROR TCPBase::Init(TcpListenParameters & params) #endif SuccessOrExit(err); - err = mListenSocket->Bind(params.GetAddressType(), Inet::IPAddress::Any, params.GetListenPort(), params.GetInterfaceId()); + err = mListenSocket->Bind(params.GetAddressType(), Inet::IPAddress::Any, params.GetListenPort(), + params.GetInterfaceId().IsPresent()); SuccessOrExit(err); err = mListenSocket->Listen(kListenBacklogSize); @@ -357,7 +358,7 @@ CHIP_ERROR TCPBase::OnTcpReceive(Inet::TCPEndPoint * endPoint, System::PacketBuf { Inet::IPAddress ipAddress; uint16_t port; - Inet::InterfaceId interfaceId = INET_NULL_INTERFACEID; + Inet::InterfaceId interfaceId; endPoint->GetPeerInfo(&ipAddress, &port); endPoint->GetInterfaceId(&interfaceId); @@ -382,7 +383,7 @@ void TCPBase::OnConnectionComplete(Inet::TCPEndPoint * endPoint, CHIP_ERROR inet TCPBase * tcp = reinterpret_cast(endPoint->AppState); Inet::IPAddress ipAddress; uint16_t port; - Inet::InterfaceId interfaceId = INET_NULL_INTERFACEID; + Inet::InterfaceId interfaceId; endPoint->GetPeerInfo(&ipAddress, &port); endPoint->GetInterfaceId(&interfaceId); @@ -512,7 +513,7 @@ void TCPBase::Disconnect(const PeerAddress & address) { Inet::IPAddress ipAddress; uint16_t port; - Inet::InterfaceId interfaceId = INET_NULL_INTERFACEID; + Inet::InterfaceId interfaceId; mActiveConnections[i].mEndPoint->GetPeerInfo(&ipAddress, &port); mActiveConnections[i].mEndPoint->GetInterfaceId(&interfaceId); diff --git a/src/transport/raw/TCP.h b/src/transport/raw/TCP.h index c09a7f62772d57..3b48aaf4f851d3 100644 --- a/src/transport/raw/TCP.h +++ b/src/transport/raw/TCP.h @@ -77,7 +77,7 @@ class TcpListenParameters Inet::InetLayer * mLayer = nullptr; ///< Associated inet layer Inet::IPAddressType mAddressType = Inet::IPAddressType::kIPv6; ///< type of listening socket uint16_t mListenPort = CHIP_PORT; ///< TCP listen port - Inet::InterfaceId mInterfaceId = INET_NULL_INTERFACEID; ///< Interface to listen on + Inet::InterfaceId mInterfaceId = Inet::InterfaceId::Null(); ///< Interface to listen on }; /** diff --git a/src/transport/raw/UDP.h b/src/transport/raw/UDP.h index 710300cb8bdc8e..e4ed2fb8e2670a 100644 --- a/src/transport/raw/UDP.h +++ b/src/transport/raw/UDP.h @@ -74,7 +74,7 @@ class UdpListenParameters Inet::InetLayer * mLayer = nullptr; ///< Associated inet layer Inet::IPAddressType mAddressType = Inet::IPAddressType::kIPv6; ///< type of listening socket uint16_t mListenPort = CHIP_PORT; ///< UDP listen port - Inet::InterfaceId mInterfaceId = INET_NULL_INTERFACEID; ///< Interface to listen on + Inet::InterfaceId mInterfaceId = Inet::InterfaceId::Null(); ///< Interface to listen on }; /** Implements a transport using UDP. */ diff --git a/src/transport/raw/tests/NetworkTestHelpers.cpp b/src/transport/raw/tests/NetworkTestHelpers.cpp index c9f150b308322b..f4a9ab18ea8305 100644 --- a/src/transport/raw/tests/NetworkTestHelpers.cpp +++ b/src/transport/raw/tests/NetworkTestHelpers.cpp @@ -26,7 +26,7 @@ namespace chip { namespace Test { -CHIP_ERROR IOContext::Init(nlTestSuite * suite) +CHIP_ERROR IOContext::Init() { CHIP_ERROR err = Platform::MemoryInit(); @@ -34,7 +34,6 @@ CHIP_ERROR IOContext::Init(nlTestSuite * suite) InitNetwork(); - mSuite = suite; mSystemLayer = &gSystemLayer; mInetLayer = &gInet; @@ -60,15 +59,15 @@ void IOContext::DriveIO() ServiceEvents(kSleepTimeMilliseconds); } -void IOContext::DriveIOUntil(unsigned maxWaitMs, std::function completionFunction) +void IOContext::DriveIOUntil(System::Clock::Timeout maxWait, std::function completionFunction) { - uint64_t mStartTime = System::SystemClock().GetMonotonicMilliseconds(); + System::Clock::Timestamp startTime = System::SystemClock().GetMonotonicTimestamp(); while (true) { DriveIO(); // at least one IO loop is guaranteed - if (completionFunction() || ((System::SystemClock().GetMonotonicMilliseconds() - mStartTime) >= maxWaitMs)) + if (completionFunction() || ((System::SystemClock().GetMonotonicTimestamp() - startTime) >= maxWait)) { break; } diff --git a/src/transport/raw/tests/NetworkTestHelpers.h b/src/transport/raw/tests/NetworkTestHelpers.h index 361ec7d9e09357..52dc3402094461 100644 --- a/src/transport/raw/tests/NetworkTestHelpers.h +++ b/src/transport/raw/tests/NetworkTestHelpers.h @@ -27,7 +27,6 @@ #include #include -#include namespace chip { namespace Test { @@ -38,7 +37,7 @@ class IOContext IOContext() {} /// Initialize the underlying layers and test suite pointer - CHIP_ERROR Init(nlTestSuite * suite); + CHIP_ERROR Init(); // Shutdown all layers, finalize operations CHIP_ERROR Shutdown(); @@ -48,14 +47,12 @@ class IOContext /// DriveIO until the specified number of milliseconds has passed or until /// completionFunction returns true - void DriveIOUntil(unsigned maxWaitMs, std::function completionFunction); + void DriveIOUntil(System::Clock::Timeout maxWait, std::function completionFunction); - nlTestSuite * GetTestSuite() { return mSuite; } System::Layer & GetSystemLayer() { return *mSystemLayer; } Inet::InetLayer & GetInetLayer() { return *mInetLayer; } private: - nlTestSuite * mSuite = nullptr; System::Layer * mSystemLayer = nullptr; Inet::InetLayer * mInetLayer = nullptr; }; diff --git a/src/transport/raw/tests/TestTCP.cpp b/src/transport/raw/tests/TestTCP.cpp index b87cf48ec0b589..5266c79a7632ea 100644 --- a/src/transport/raw/tests/TestTCP.cpp +++ b/src/transport/raw/tests/TestTCP.cpp @@ -142,7 +142,7 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate NL_TEST_ASSERT(mSuite, err == CHIP_NO_ERROR); - mContext.DriveIOUntil(5000 /* ms */, [this]() { return mReceiveHandlerCallCount != 0; }); + mContext.DriveIOUntil(chip::System::Clock::Seconds16(5), [this]() { return mReceiveHandlerCallCount != 0; }); NL_TEST_ASSERT(mSuite, mReceiveHandlerCallCount == 1); SetCallback(nullptr); @@ -152,7 +152,7 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate { // Disconnect and wait for seeing peer close tcp.Disconnect(Transport::PeerAddress::TCP(addr)); - mContext.DriveIOUntil(5000 /* ms */, [&tcp]() { return !tcp.HasActiveConnections(); }); + mContext.DriveIOUntil(chip::System::Clock::Seconds16(5), [&tcp]() { return !tcp.HasActiveConnections(); }); } int mReceiveHandlerCallCount = 0; @@ -475,7 +475,7 @@ static nlTestSuite sSuite = */ static int Initialize(void * aContext) { - CHIP_ERROR err = reinterpret_cast(aContext)->Init(&sSuite); + CHIP_ERROR err = reinterpret_cast(aContext)->Init(); return (err == CHIP_NO_ERROR) ? SUCCESS : FAILURE; } diff --git a/src/transport/raw/tests/TestUDP.cpp b/src/transport/raw/tests/TestUDP.cpp index dd997a21f47457..88057e6770809b 100644 --- a/src/transport/raw/tests/TestUDP.cpp +++ b/src/transport/raw/tests/TestUDP.cpp @@ -150,7 +150,7 @@ void CheckMessageTest(nlTestSuite * inSuite, void * inContext, const IPAddress & NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - ctx.DriveIOUntil(1000 /* ms */, []() { return ReceiveHandlerCallCount != 0; }); + ctx.DriveIOUntil(chip::System::Clock::Seconds16(1), []() { return ReceiveHandlerCallCount != 0; }); NL_TEST_ASSERT(inSuite, ReceiveHandlerCallCount == 1); } diff --git a/src/transport/tests/TestPeerConnections.cpp b/src/transport/tests/TestPeerConnections.cpp index 60b94eba794c8e..55ee2b2665b5d3 100644 --- a/src/transport/tests/TestPeerConnections.cpp +++ b/src/transport/tests/TestPeerConnections.cpp @@ -58,92 +58,61 @@ void TestBasicFunctionality(nlTestSuite * inSuite, void * inContext) SecureSessionTable<2, Time::Source::kTest> connections; connections.GetTimeSource().SetCurrentMonotonicTimeMs(100); - err = connections.CreateNewPeerConnectionState(kPeer1Addr, nullptr); + // Node ID 1, peer key 1, local key 2 + err = connections.CreateNewSecureSession(kPeer1NodeId, 1, 2, nullptr); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = connections.CreateNewPeerConnectionState(kPeer2Addr, &statePtr); + // Node ID 2, peer key 3, local key 4 + err = connections.CreateNewSecureSession(kPeer2NodeId, 3, 4, &statePtr); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, statePtr != nullptr); - NL_TEST_ASSERT(inSuite, statePtr->GetPeerAddress() == kPeer2Addr); + NL_TEST_ASSERT(inSuite, statePtr->GetPeerNodeId() == kPeer2NodeId); NL_TEST_ASSERT(inSuite, statePtr->GetLastActivityTimeMs() == 100); // Insufficient space for new connections. Object is max size 2 - err = connections.CreateNewPeerConnectionState(kPeer3Addr, &statePtr); + err = connections.CreateNewSecureSession(kPeer3NodeId, 5, 6, &statePtr); NL_TEST_ASSERT(inSuite, err != CHIP_NO_ERROR); } -void TestFindByAddress(nlTestSuite * inSuite, void * inContext) -{ - CHIP_ERROR err; - SecureSession * statePtr; - SecureSessionTable<3, Time::Source::kTest> connections; - - SecureSession * state1 = nullptr; - SecureSession * state2 = nullptr; - SecureSession * state3 = nullptr; - - err = connections.CreateNewPeerConnectionState(kPeer1Addr, &state1); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - - err = connections.CreateNewPeerConnectionState(kPeer1Addr, &state2); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - - err = connections.CreateNewPeerConnectionState(kPeer2Addr, &state3); - NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - - NL_TEST_ASSERT(inSuite, state1 != state2); - NL_TEST_ASSERT(inSuite, state1 != state3); - NL_TEST_ASSERT(inSuite, state2 != state3); - - NL_TEST_ASSERT(inSuite, statePtr = connections.FindPeerConnectionState(kPeer1Addr, nullptr)); - NL_TEST_ASSERT(inSuite, statePtr->GetPeerAddress() == kPeer1Addr); - - NL_TEST_ASSERT(inSuite, statePtr = connections.FindPeerConnectionState(kPeer1Addr, statePtr)); - NL_TEST_ASSERT(inSuite, statePtr->GetPeerAddress() == kPeer1Addr); - - NL_TEST_ASSERT(inSuite, (statePtr = connections.FindPeerConnectionState(kPeer1Addr, statePtr)) == nullptr); - - NL_TEST_ASSERT(inSuite, statePtr = connections.FindPeerConnectionState(kPeer2Addr, nullptr)); - NL_TEST_ASSERT(inSuite, statePtr->GetPeerAddress() == kPeer2Addr); - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionState(kPeer3Addr, nullptr)); -} - void TestFindByNodeId(nlTestSuite * inSuite, void * inContext) { CHIP_ERROR err; SecureSession * statePtr; SecureSessionTable<3, Time::Source::kTest> connections; - err = connections.CreateNewPeerConnectionState(kPeer1Addr, &statePtr); + // Node ID 1, peer key 1, local key 2 + err = connections.CreateNewSecureSession(kPeer1NodeId, 1, 2, &statePtr); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - statePtr->SetPeerNodeId(kPeer1NodeId); + statePtr->SetPeerAddress(kPeer1Addr); - err = connections.CreateNewPeerConnectionState(kPeer2Addr, &statePtr); + // Node ID 2, peer key 3, local key 4 + err = connections.CreateNewSecureSession(kPeer2NodeId, 3, 4, &statePtr); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - statePtr->SetPeerNodeId(kPeer2NodeId); + statePtr->SetPeerAddress(kPeer2Addr); - err = connections.CreateNewPeerConnectionState(kPeer2Addr, &statePtr); + // Same Node ID 1, peer key 5, local key 6 + err = connections.CreateNewSecureSession(kPeer1NodeId, 5, 6, &statePtr); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - statePtr->SetPeerNodeId(kPeer1NodeId); + statePtr->SetPeerAddress(kPeer3Addr); - NL_TEST_ASSERT(inSuite, statePtr = connections.FindPeerConnectionState(kPeer1NodeId, nullptr)); + NL_TEST_ASSERT(inSuite, statePtr = connections.FindSecureSession(kPeer1NodeId, nullptr)); char buf[100]; statePtr->GetPeerAddress().ToString(buf); NL_TEST_ASSERT(inSuite, statePtr->GetPeerAddress() == kPeer1Addr); NL_TEST_ASSERT(inSuite, statePtr->GetPeerNodeId() == kPeer1NodeId); - NL_TEST_ASSERT(inSuite, statePtr = connections.FindPeerConnectionState(kPeer1NodeId, statePtr)); + NL_TEST_ASSERT(inSuite, statePtr = connections.FindSecureSession(kPeer1NodeId, statePtr)); statePtr->GetPeerAddress().ToString(buf); - NL_TEST_ASSERT(inSuite, statePtr->GetPeerAddress() == kPeer2Addr); + NL_TEST_ASSERT(inSuite, statePtr->GetPeerAddress() == kPeer3Addr); NL_TEST_ASSERT(inSuite, statePtr->GetPeerNodeId() == kPeer1NodeId); - NL_TEST_ASSERT(inSuite, (statePtr = connections.FindPeerConnectionState(kPeer1NodeId, statePtr)) == nullptr); + NL_TEST_ASSERT(inSuite, (statePtr = connections.FindSecureSession(kPeer1NodeId, statePtr)) == nullptr); - NL_TEST_ASSERT(inSuite, statePtr = connections.FindPeerConnectionState(kPeer2NodeId, nullptr)); + NL_TEST_ASSERT(inSuite, statePtr = connections.FindSecureSession(kPeer2NodeId, nullptr)); NL_TEST_ASSERT(inSuite, statePtr->GetPeerAddress() == kPeer2Addr); NL_TEST_ASSERT(inSuite, statePtr->GetPeerNodeId() == kPeer2NodeId); - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionState(kPeer3NodeId, nullptr)); + NL_TEST_ASSERT(inSuite, !connections.FindSecureSession(kPeer3NodeId, nullptr)); } void TestFindByKeyId(nlTestSuite * inSuite, void * inContext) @@ -152,44 +121,19 @@ void TestFindByKeyId(nlTestSuite * inSuite, void * inContext) SecureSession * statePtr; SecureSessionTable<2, Time::Source::kTest> connections; - // No Node ID, peer key 1, local key 2 - err = connections.CreateNewPeerConnectionState(Optional::Missing(), 1, 2, &statePtr); + // Node ID 1, peer key 1, local key 2 + err = connections.CreateNewSecureSession(kPeer1NodeId, 1, 2, &statePtr); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - // Lookup using no node, and peer key - NL_TEST_ASSERT(inSuite, connections.FindPeerConnectionState(Optional::Missing(), 1, nullptr)); - // Lookup using no node, and local key - NL_TEST_ASSERT(inSuite, connections.FindPeerConnectionStateByLocalKey(Optional::Missing(), 2, nullptr)); - - // Lookup using no node, and incorrect peer key - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionState(Optional::Missing(), 2, nullptr)); - - // Lookup using no node, and incorrect local key - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionStateByLocalKey(Optional::Missing(), 1, nullptr)); - - // Lookup using a node ID, and peer key - NL_TEST_ASSERT(inSuite, connections.FindPeerConnectionState(Optional::Value(kPeer1NodeId), 1, nullptr)); + NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(1, nullptr)); + NL_TEST_ASSERT(inSuite, connections.FindSecureSessionByLocalKey(2, nullptr)); - // Lookup using a node ID, and local key - NL_TEST_ASSERT(inSuite, connections.FindPeerConnectionStateByLocalKey(Optional::Value(kPeer1NodeId), 2, nullptr)); - - // Some Node ID, peer key 3, local key 4 - err = connections.CreateNewPeerConnectionState(Optional::Value(kPeer1NodeId), 3, 4, &statePtr); + // Node ID 2, peer key 3, local key 4 + err = connections.CreateNewSecureSession(kPeer2NodeId, 3, 4, &statePtr); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - // Lookup using correct node (or no node), and correct keys - NL_TEST_ASSERT(inSuite, connections.FindPeerConnectionState(Optional::Value(kPeer1NodeId), 3, nullptr)); - NL_TEST_ASSERT(inSuite, connections.FindPeerConnectionStateByLocalKey(Optional::Value(kPeer1NodeId), 4, nullptr)); - NL_TEST_ASSERT(inSuite, connections.FindPeerConnectionState(Optional::Missing(), 3, nullptr)); - NL_TEST_ASSERT(inSuite, connections.FindPeerConnectionStateByLocalKey(Optional::Missing(), 4, nullptr)); - - // Lookup using incorrect keys - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionState(Optional::Value(kPeer1NodeId), 4, nullptr)); - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionStateByLocalKey(Optional::Value(kPeer1NodeId), 3, nullptr)); - - // Lookup using incorrect node, but correct keys - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionState(Optional::Value(kPeer2NodeId), 3, nullptr)); - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionStateByLocalKey(Optional::Value(kPeer2NodeId), 4, nullptr)); + NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(3, nullptr)); + NL_TEST_ASSERT(inSuite, connections.FindSecureSessionByLocalKey(4, nullptr)); } struct ExpiredCallInfo @@ -208,40 +152,44 @@ void TestExpireConnections(nlTestSuite * inSuite, void * inContext) connections.GetTimeSource().SetCurrentMonotonicTimeMs(100); - err = connections.CreateNewPeerConnectionState(kPeer1Addr, nullptr); + // Node ID 1, peer key 1, local key 2 + err = connections.CreateNewSecureSession(kPeer1NodeId, 1, 2, &statePtr); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + statePtr->SetPeerAddress(kPeer1Addr); connections.GetTimeSource().SetCurrentMonotonicTimeMs(200); - err = connections.CreateNewPeerConnectionState(kPeer2Addr, &statePtr); + // Node ID 2, peer key 3, local key 4 + err = connections.CreateNewSecureSession(kPeer2NodeId, 3, 4, &statePtr); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - statePtr->SetPeerNodeId(kPeer2NodeId); + statePtr->SetPeerAddress(kPeer2Addr); // cannot add before expiry connections.GetTimeSource().SetCurrentMonotonicTimeMs(300); - err = connections.CreateNewPeerConnectionState(kPeer3Addr, &statePtr); + err = connections.CreateNewSecureSession(kPeer3NodeId, 5, 6, &statePtr); NL_TEST_ASSERT(inSuite, err != CHIP_NO_ERROR); // at time 300, this expires ip addr 1 - connections.ExpireInactiveConnections(150, [&callInfo](const SecureSession & state) { + connections.ExpireInactiveSessions(150, [&callInfo](const SecureSession & state) { callInfo.callCount++; callInfo.lastCallNodeId = state.GetPeerNodeId(); callInfo.lastCallPeerAddress = state.GetPeerAddress(); }); NL_TEST_ASSERT(inSuite, callInfo.callCount == 1); - NL_TEST_ASSERT(inSuite, callInfo.lastCallNodeId == kUndefinedNodeId); + NL_TEST_ASSERT(inSuite, callInfo.lastCallNodeId == kPeer1NodeId); NL_TEST_ASSERT(inSuite, callInfo.lastCallPeerAddress == kPeer1Addr); - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionState(kPeer1NodeId, nullptr)); + NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(2, nullptr)); // now that the connections were expired, we can add peer3 connections.GetTimeSource().SetCurrentMonotonicTimeMs(300); - err = connections.CreateNewPeerConnectionState(kPeer3Addr, &statePtr); + // Node ID 3, peer key 5, local key 6 + err = connections.CreateNewSecureSession(kPeer3NodeId, 5, 6, &statePtr); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - statePtr->SetPeerNodeId(kPeer3NodeId); + statePtr->SetPeerAddress(kPeer3Addr); connections.GetTimeSource().SetCurrentMonotonicTimeMs(400); - NL_TEST_ASSERT(inSuite, statePtr = connections.FindPeerConnectionState(kPeer2NodeId, nullptr)); + NL_TEST_ASSERT(inSuite, statePtr = connections.FindSecureSessionByLocalKey(4, nullptr)); - connections.MarkConnectionActive(statePtr); + connections.MarkSessionActive(statePtr); NL_TEST_ASSERT(inSuite, statePtr->GetLastActivityTimeMs() == connections.GetTimeSource().GetCurrentMonotonicTimeMs()); // At this time: @@ -250,7 +198,7 @@ void TestExpireConnections(nlTestSuite * inSuite, void * inContext) connections.GetTimeSource().SetCurrentMonotonicTimeMs(500); callInfo.callCount = 0; - connections.ExpireInactiveConnections(150, [&callInfo](const SecureSession & state) { + connections.ExpireInactiveSessions(150, [&callInfo](const SecureSession & state) { callInfo.callCount++; callInfo.lastCallNodeId = state.GetPeerNodeId(); callInfo.lastCallPeerAddress = state.GetPeerAddress(); @@ -260,28 +208,29 @@ void TestExpireConnections(nlTestSuite * inSuite, void * inContext) NL_TEST_ASSERT(inSuite, callInfo.callCount == 1); NL_TEST_ASSERT(inSuite, callInfo.lastCallNodeId == kPeer3NodeId); NL_TEST_ASSERT(inSuite, callInfo.lastCallPeerAddress == kPeer3Addr); - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionState(kPeer1Addr, nullptr)); - NL_TEST_ASSERT(inSuite, connections.FindPeerConnectionState(kPeer2Addr, nullptr)); - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionState(kPeer3Addr, nullptr)); + NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(2, nullptr)); + NL_TEST_ASSERT(inSuite, connections.FindSecureSessionByLocalKey(4, nullptr)); + NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(6, nullptr)); - err = connections.CreateNewPeerConnectionState(kPeer1Addr, nullptr); + // Node ID 1, peer key 1, local key 2 + err = connections.CreateNewSecureSession(kPeer1NodeId, 1, 2, &statePtr); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, connections.FindPeerConnectionState(kPeer1Addr, nullptr)); - NL_TEST_ASSERT(inSuite, connections.FindPeerConnectionState(kPeer2Addr, nullptr)); - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionState(kPeer3Addr, nullptr)); + NL_TEST_ASSERT(inSuite, connections.FindSecureSessionByLocalKey(2, nullptr)); + NL_TEST_ASSERT(inSuite, connections.FindSecureSessionByLocalKey(4, nullptr)); + NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(6, nullptr)); // peer 1 and 2 are active connections.GetTimeSource().SetCurrentMonotonicTimeMs(1000); callInfo.callCount = 0; - connections.ExpireInactiveConnections(100, [&callInfo](const SecureSession & state) { + connections.ExpireInactiveSessions(100, [&callInfo](const SecureSession & state) { callInfo.callCount++; callInfo.lastCallNodeId = state.GetPeerNodeId(); callInfo.lastCallPeerAddress = state.GetPeerAddress(); }); NL_TEST_ASSERT(inSuite, callInfo.callCount == 2); // everything expired - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionState(kPeer1Addr, nullptr)); - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionState(kPeer2Addr, nullptr)); - NL_TEST_ASSERT(inSuite, !connections.FindPeerConnectionState(kPeer3Addr, nullptr)); + NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(2, nullptr)); + NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(4, nullptr)); + NL_TEST_ASSERT(inSuite, !connections.FindSecureSessionByLocalKey(6, nullptr)); } } // namespace @@ -290,7 +239,6 @@ void TestExpireConnections(nlTestSuite * inSuite, void * inContext) static const nlTest sTests[] = { NL_TEST_DEF("BasicFunctionality", TestBasicFunctionality), - NL_TEST_DEF("FindByPeerAddress", TestFindByAddress), NL_TEST_DEF("FindByNodeId", TestFindByNodeId), NL_TEST_DEF("FindByKeyId", TestFindByKeyId), NL_TEST_DEF("ExpireConnections", TestExpireConnections), diff --git a/src/transport/tests/TestSessionManager.cpp b/src/transport/tests/TestSessionManager.cpp index 14025c42b0e215..5c7a9d7ebfda23 100644 --- a/src/transport/tests/TestSessionManager.cpp +++ b/src/transport/tests/TestSessionManager.cpp @@ -492,7 +492,7 @@ nlTestSuite sSuite = */ int Initialize(void * aContext) { - CHIP_ERROR err = reinterpret_cast(aContext)->Init(&sSuite); + CHIP_ERROR err = reinterpret_cast(aContext)->Init(); return (err == CHIP_NO_ERROR) ? SUCCESS : FAILURE; } diff --git a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp index eb357f056e246e..ad4f5230b60869 100644 --- a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp @@ -943,6 +943,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } break; } + case Commands::TriggerEffect::Id: { + Commands::TriggerEffect::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfIdentifyClusterTriggerEffectCallback(apCommandObj, aCommandPath, commandData); + } + break; + } default: { // Unrecognized command ID, error status will apply. ReportCommandUnsupported(apCommandObj, aCommandPath); @@ -1683,6 +1692,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } break; } + case Commands::TestNullableOptionalRequest::Id: { + Commands::TestNullableOptionalRequest::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfTestClusterClusterTestNullableOptionalRequestCallback(apCommandObj, aCommandPath, commandData); + } + break; + } case Commands::TestSpecific::Id: { Commands::TestSpecific::DecodableType commandData; TLVError = DataModel::Decode(aDataTlv, commandData); diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 0f388d2b5d047e..767d9cb865ef15 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -575,22 +575,27 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 1, Cluster: Window Covering (server), big-endian */ \ + \ + /* 4482 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */ \ \ - /* 4482 - LifetimeEnergyConsumed, */ \ + /* 4486 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4486 - FeatureMap, */ \ + /* 4490 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), big-endian */ \ \ - /* 4490 - FeatureMap, */ \ + /* 4494 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ \ /* Endpoint: 1, Cluster: Color Control (server), big-endian */ \ \ - /* 4494 - compensation text, */ \ + /* 4498 - compensation text, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -608,18 +613,18 @@ \ /* Endpoint: 1, Cluster: IAS Zone (server), big-endian */ \ \ - /* 4749 - IAS CIE address, */ \ + /* 4753 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Wake on LAN (server), big-endian */ \ \ - /* 4757 - wake on lan mac address, */ \ + /* 4761 - wake on lan mac address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: TV Channel (server), big-endian */ \ \ - /* 4790 - tv channel list, */ \ + /* 4794 - tv channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -635,17 +640,17 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5044 - tv channel lineup, */ \ + /* 5048 - tv channel lineup, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5077 - current tv channel, */ \ + /* 5081 - current tv channel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Target Navigator (server), big-endian */ \ \ - /* 5110 - target navigator list, */ \ + /* 5114 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -663,30 +668,30 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), big-endian */ \ \ - /* 5364 - start time, */ \ + /* 5368 - start time, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \ \ - /* 5372 - duration, */ \ + /* 5376 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5380 - position updated at, */ \ + /* 5384 - position updated at, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5388 - position, */ \ + /* 5392 - position, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5396 - playback speed, */ \ + /* 5400 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5404 - seek range end, */ \ + /* 5408 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5412 - seek range start, */ \ + /* 5416 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), big-endian */ \ \ - /* 5420 - media input list, */ \ + /* 5424 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -704,7 +709,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), big-endian */ \ \ - /* 5674 - accepts header list, */ \ + /* 5678 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -720,7 +725,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5928 - supported streaming types, */ \ + /* 5932 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -738,7 +743,7 @@ \ /* Endpoint: 1, Cluster: Audio Output (server), big-endian */ \ \ - /* 6182 - audio output list, */ \ + /* 6186 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -756,7 +761,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), big-endian */ \ \ - /* 6436 - application launcher list, */ \ + /* 6440 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -774,45 +779,45 @@ \ /* Endpoint: 1, Cluster: Application Basic (server), big-endian */ \ \ - /* 6690 - vendor name, */ \ + /* 6694 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6723 - application name, */ \ + /* 6727 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6756 - application id, */ \ + /* 6760 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ \ - /* 6789 - bitmap32, */ \ + /* 6793 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 6793 - bitmap64, */ \ + /* 6797 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6801 - int32u, */ \ + /* 6805 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 6805 - int64u, */ \ + /* 6809 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6813 - int32s, */ \ + /* 6817 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 6817 - int64s, */ \ + /* 6821 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6825 - octet_string, */ \ + /* 6829 - octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6836 - list_int8u, */ \ + /* 6840 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6846 - list_octet_string, */ \ + /* 6850 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -828,7 +833,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 7100 - list_struct_octet_string, */ \ + /* 7104 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -844,7 +849,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 7354 - long_octet_string, */ \ + /* 7358 - long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -899,10 +904,10 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 8356 - char_string, */ \ + /* 8360 - char_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 8367 - long_char_string, */ \ + /* 8371 - long_char_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -957,23 +962,23 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 9369 - epoch_us, */ \ + /* 9373 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 9377 - epoch_s, */ \ + /* 9381 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), big-endian */ \ \ - /* 9381 - measurement type, */ \ + /* 9385 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 9385 - total active power, */ \ + /* 9389 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), big-endian */ \ \ - /* 9389 - FeatureMap, */ \ + /* 9393 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } @@ -1529,22 +1534,27 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 1, Cluster: Window Covering (server), little-endian */ \ + \ + /* 4482 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server), little-endian */ \ \ - /* 4482 - LifetimeEnergyConsumed, */ \ + /* 4486 - LifetimeEnergyConsumed, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 4486 - FeatureMap, */ \ + /* 4490 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Thermostat (server), little-endian */ \ \ - /* 4490 - FeatureMap, */ \ + /* 4494 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x0B, \ \ /* Endpoint: 1, Cluster: Color Control (server), little-endian */ \ \ - /* 4494 - compensation text, */ \ + /* 4498 - compensation text, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1562,18 +1572,18 @@ \ /* Endpoint: 1, Cluster: IAS Zone (server), little-endian */ \ \ - /* 4749 - IAS CIE address, */ \ + /* 4753 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Wake on LAN (server), little-endian */ \ \ - /* 4757 - wake on lan mac address, */ \ + /* 4761 - wake on lan mac address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: TV Channel (server), little-endian */ \ \ - /* 4790 - tv channel list, */ \ + /* 4794 - tv channel list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1589,17 +1599,17 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5044 - tv channel lineup, */ \ + /* 5048 - tv channel lineup, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5077 - current tv channel, */ \ + /* 5081 - current tv channel, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Target Navigator (server), little-endian */ \ \ - /* 5110 - target navigator list, */ \ + /* 5114 - target navigator list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1617,30 +1627,30 @@ \ /* Endpoint: 1, Cluster: Media Playback (server), little-endian */ \ \ - /* 5364 - start time, */ \ + /* 5368 - start time, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, \ \ - /* 5372 - duration, */ \ + /* 5376 - duration, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5380 - position updated at, */ \ + /* 5384 - position updated at, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5388 - position, */ \ + /* 5392 - position, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5396 - playback speed, */ \ + /* 5400 - playback speed, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5404 - seek range end, */ \ + /* 5408 - seek range end, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5412 - seek range start, */ \ + /* 5416 - seek range start, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Media Input (server), little-endian */ \ \ - /* 5420 - media input list, */ \ + /* 5424 - media input list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1658,7 +1668,7 @@ \ /* Endpoint: 1, Cluster: Content Launcher (server), little-endian */ \ \ - /* 5674 - accepts header list, */ \ + /* 5678 - accepts header list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1674,7 +1684,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 5928 - supported streaming types, */ \ + /* 5932 - supported streaming types, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1692,7 +1702,7 @@ \ /* Endpoint: 1, Cluster: Audio Output (server), little-endian */ \ \ - /* 6182 - audio output list, */ \ + /* 6186 - audio output list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1710,7 +1720,7 @@ \ /* Endpoint: 1, Cluster: Application Launcher (server), little-endian */ \ \ - /* 6436 - application launcher list, */ \ + /* 6440 - application launcher list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1728,45 +1738,45 @@ \ /* Endpoint: 1, Cluster: Application Basic (server), little-endian */ \ \ - /* 6690 - vendor name, */ \ + /* 6694 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6723 - application name, */ \ + /* 6727 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6756 - application id, */ \ + /* 6760 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ \ - /* 6789 - bitmap32, */ \ + /* 6793 - bitmap32, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 6793 - bitmap64, */ \ + /* 6797 - bitmap64, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6801 - int32u, */ \ + /* 6805 - int32u, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 6805 - int64u, */ \ + /* 6809 - int64u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6813 - int32s, */ \ + /* 6817 - int32s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 6817 - int64s, */ \ + /* 6821 - int64s, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6825 - octet_string, */ \ + /* 6829 - octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6836 - list_int8u, */ \ + /* 6840 - list_int8u, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 6846 - list_octet_string, */ \ + /* 6850 - list_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1782,7 +1792,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 7100 - list_struct_octet_string, */ \ + /* 7104 - list_struct_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1798,7 +1808,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 7354 - long_octet_string, */ \ + /* 7358 - long_octet_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1853,10 +1863,10 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 8356 - char_string, */ \ + /* 8360 - char_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 8367 - long_char_string, */ \ + /* 8371 - long_char_string, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -1911,29 +1921,29 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 9369 - epoch_us, */ \ + /* 9373 - epoch_us, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 9377 - epoch_s, */ \ + /* 9381 - epoch_s, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server), little-endian */ \ \ - /* 9381 - measurement type, */ \ + /* 9385 - measurement type, */ \ 0x00, 0x00, 0x00, 0x00, \ \ - /* 9385 - total active power, */ \ + /* 9389 - total active power, */ \ 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: On/Off (server), little-endian */ \ \ - /* 9389 - FeatureMap, */ \ + /* 9393 - FeatureMap, */ \ 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (150) +#define GENERATED_DEFAULTS_COUNT (151) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -1961,7 +1971,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 481 +#define GENERATED_ATTRIBUTE_COUNT 486 #define GENERATED_ATTRIBUTES \ { \ \ @@ -2290,6 +2300,7 @@ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitTilt */ \ { 0x0017, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* Mode */ \ { 0x001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* SafetyStatus */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4482) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ @@ -2318,11 +2329,11 @@ { 0x0012, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* EffectiveControlMode */ \ { 0x0013, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Capacity */ \ { 0x0014, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Speed */ \ - { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4482) }, /* LifetimeEnergyConsumed */ \ + { 0x0017, ZAP_TYPE(INT32U), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4486) }, /* LifetimeEnergyConsumed */ \ { 0x0020, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* OperationMode */ \ { 0x0021, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* ControlMode */ \ { 0x0022, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* AlarmMask */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4486) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4490) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ @@ -2342,14 +2353,15 @@ { 0x0017, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0x0640) }, /* min cool setpoint limit */ \ { 0x0018, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_SIMPLE_DEFAULT(0x0C80) }, /* max cool setpoint limit */ \ + ZAP_SIMPLE_DEFAULT(0x0C80) }, /* max cool setpoint limit */ \ + { 0x0019, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x19) }, /* min setpoint dead band */ \ { 0x001B, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0x04) }, /* control sequence of operation */ \ { 0x001C, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x01) }, /* system mode */ \ { 0x0020, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0) }, /* start of week */ \ { 0x0021, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(7) }, /* number of weekly transitions */ \ { 0x0022, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(4) }, /* number of daily transitions */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4490) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(4494) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ @@ -2366,7 +2378,7 @@ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x616B) }, /* current x */ \ { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x607D) }, /* current y */ \ { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* drift compensation */ \ - { 0x0006, ZAP_TYPE(CHAR_STRING), 255, 0, ZAP_LONG_DEFAULTS_INDEX(4494) }, /* compensation text */ \ + { 0x0006, ZAP_TYPE(CHAR_STRING), 255, 0, ZAP_LONG_DEFAULTS_INDEX(4498) }, /* compensation text */ \ { 0x0007, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x00FA) }, /* color temperature */ \ { 0x0008, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* color mode */ \ { 0x000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* color control options */ \ @@ -2424,9 +2436,10 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ - { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* measured value */ \ - { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* min measured value */ \ - { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* max measured value */ \ + { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \ + { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \ + { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Tolerance */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ @@ -2436,15 +2449,17 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ - { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* measured value */ \ - { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* min measured value */ \ - { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* max measured value */ \ + { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MeasuredValue */ \ + { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinMeasuredValue */ \ + { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxMeasuredValue */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0) }, /* Tolerance */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* measured value */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* min measured value */ \ { 0x0002, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* max measured value */ \ + { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* tolerance */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ @@ -2457,37 +2472,37 @@ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* zone state */ \ { 0x0001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ - { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(4749) }, /* IAS CIE address */ \ + { 0x0010, ZAP_TYPE(NODE_ID), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(4753) }, /* IAS CIE address */ \ { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(4757) }, /* wake on lan mac address */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(4761) }, /* wake on lan mac address */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: TV Channel (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4790) }, /* tv channel list */ \ - { 0x0001, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5044) }, /* tv channel lineup */ \ - { 0x0002, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5077) }, /* current tv channel */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(4794) }, /* tv channel list */ \ + { 0x0001, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5048) }, /* tv channel lineup */ \ + { 0x0002, ZAP_TYPE(OCTET_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(5081) }, /* current tv channel */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5110) }, /* target navigator list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5114) }, /* target navigator list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* playback state */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5364) }, /* start time */ \ - { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5372) }, /* duration */ \ - { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5380) }, /* position updated at */ \ - { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5388) }, /* position */ \ - { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5396) }, /* playback speed */ \ - { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5404) }, /* seek range end */ \ - { 0x0007, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5412) }, /* seek range start */ \ + { 0x0001, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5368) }, /* start time */ \ + { 0x0002, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5376) }, /* duration */ \ + { 0x0003, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5384) }, /* position updated at */ \ + { 0x0004, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5392) }, /* position */ \ + { 0x0005, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5400) }, /* playback speed */ \ + { 0x0006, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5408) }, /* seek range end */ \ + { 0x0007, ZAP_TYPE(INT64U), 8, 0, ZAP_LONG_DEFAULTS_INDEX(5416) }, /* seek range start */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Media Input (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5420) }, /* media input list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5424) }, /* media input list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current media input */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ @@ -2498,27 +2513,27 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5674) }, /* accepts header list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5928) }, /* supported streaming types */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5678) }, /* accepts header list */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(5932) }, /* supported streaming types */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6182) }, /* audio output list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6186) }, /* audio output list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current audio output */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6436) }, /* application launcher list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6440) }, /* application launcher list */ \ { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* catalog vendor id */ \ { 0x0002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* application id */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(6690) }, /* vendor name */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(6694) }, /* vendor name */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(6723) }, /* application name */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(6727) }, /* application name */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x0005, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(6756) }, /* application id */ \ + { 0x0005, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(6760) }, /* application id */ \ { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* catalog vendor id */ \ { 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* application status */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ @@ -2530,36 +2545,36 @@ { 0x0000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ { 0x0001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ - { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(6789) }, /* bitmap32 */ \ - { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(6793) }, /* bitmap64 */ \ + { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(6793) }, /* bitmap32 */ \ + { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(6797) }, /* bitmap64 */ \ { 0x0005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ { 0x0006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ - { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(6801) }, /* int32u */ \ - { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(6805) }, /* int64u */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(6805) }, /* int32u */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(6809) }, /* int64u */ \ { 0x000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ { 0x000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ - { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(6813) }, /* int32s */ \ - { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(6817) }, /* int64s */ \ + { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(6817) }, /* int32s */ \ + { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(6821) }, /* int64s */ \ { 0x0015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ { 0x0016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ { 0x0019, ZAP_TYPE(OCTET_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(6825) }, /* octet_string */ \ - { 0x001A, ZAP_TYPE(ARRAY), 10, 0, ZAP_LONG_DEFAULTS_INDEX(6836) }, /* list_int8u */ \ - { 0x001B, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6846) }, /* list_octet_string */ \ - { 0x001C, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(7100) }, /* list_struct_octet_string */ \ + ZAP_LONG_DEFAULTS_INDEX(6829) }, /* octet_string */ \ + { 0x001A, ZAP_TYPE(ARRAY), 10, 0, ZAP_LONG_DEFAULTS_INDEX(6840) }, /* list_int8u */ \ + { 0x001B, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(6850) }, /* list_octet_string */ \ + { 0x001C, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(7104) }, /* list_struct_octet_string */ \ { 0x001D, ZAP_TYPE(LONG_OCTET_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(7354) }, /* long_octet_string */ \ - { 0x001E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(8356) }, /* char_string */ \ + ZAP_LONG_DEFAULTS_INDEX(7358) }, /* long_octet_string */ \ + { 0x001E, ZAP_TYPE(CHAR_STRING), 11, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(8360) }, /* char_string */ \ { 0x001F, ZAP_TYPE(LONG_CHAR_STRING), 1002, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(8367) }, /* long_char_string */ \ - { 0x0020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(9369) }, /* epoch_us */ \ - { 0x0021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(9377) }, /* epoch_s */ \ + ZAP_LONG_DEFAULTS_INDEX(8371) }, /* long_char_string */ \ + { 0x0020, ZAP_TYPE(EPOCH_US), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(9373) }, /* epoch_us */ \ + { 0x0021, ZAP_TYPE(EPOCH_S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(9381) }, /* epoch_s */ \ { 0x0022, ZAP_TYPE(VENDOR_ID), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* vendor_id */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ - { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(9381) }, /* measurement type */ \ - { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(9385) }, /* total active power */ \ + { 0x0000, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(9385) }, /* measurement type */ \ + { 0x0304, ZAP_TYPE(INT32S), 4, 0, ZAP_LONG_DEFAULTS_INDEX(9389) }, /* total active power */ \ { 0x0505, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xffff) }, /* rms voltage */ \ { 0x0506, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage min */ \ { 0x0507, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* rms voltage max */ \ @@ -2580,7 +2595,7 @@ { 0x4001, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OnTime */ \ { 0x4002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* OffWaitTime */ \ { 0x4003, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* StartUpOnOff */ \ - { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(9389) }, /* FeatureMap */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(9393) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(4) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ @@ -2795,115 +2810,115 @@ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(230), 19, 31, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(230), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ { \ - 0x0103, ZAP_ATTRIBUTE_INDEX(249), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0103, ZAP_ATTRIBUTE_INDEX(250), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { \ 0x0200, \ - ZAP_ATTRIBUTE_INDEX(254), \ + ZAP_ATTRIBUTE_INDEX(255), \ 24, \ 48, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayPumpConfigurationAndControlServer \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { \ - 0x0201, ZAP_ATTRIBUTE_INDEX(278), 18, 33, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0201, ZAP_ATTRIBUTE_INDEX(279), 19, 34, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ { \ - 0x0204, ZAP_ATTRIBUTE_INDEX(296), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0204, ZAP_ATTRIBUTE_INDEX(298), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(300), \ + ZAP_ATTRIBUTE_INDEX(302), \ 53, \ 341, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x0400, ZAP_ATTRIBUTE_INDEX(353), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0400, ZAP_ATTRIBUTE_INDEX(355), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(359), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(361), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(363), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(366), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(367), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(370), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(371), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(375), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(375), \ + ZAP_ATTRIBUTE_INDEX(380), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOccupancySensingServer }, /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ { 0x0500, \ - ZAP_ATTRIBUTE_INDEX(379), \ + ZAP_ATTRIBUTE_INDEX(384), \ 6, \ 16, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(385), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(390), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(387), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0504, ZAP_ATTRIBUTE_INDEX(392), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: TV Channel (server) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(391), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(396), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(393), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(398), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(402), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(407), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(405), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(410), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(406), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(411), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(407), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(412), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(410), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(415), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(413), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(418), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(417), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(422), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(425), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(430), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Account Login (server) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(426), 26, 2609, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(431), 26, 2609, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { \ - 0x0B04, ZAP_ATTRIBUTE_INDEX(452), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0B04, ZAP_ATTRIBUTE_INDEX(457), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(464), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(469), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(465), \ + ZAP_ATTRIBUTE_INDEX(470), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(472), 5, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(477), 5, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(477), \ + ZAP_ATTRIBUTE_INDEX(482), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2915,7 +2930,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 18, 3376 }, { ZAP_CLUSTER_INDEX(18), 42, 6520 }, { ZAP_CLUSTER_INDEX(60), 3, 20 }, \ + { ZAP_CLUSTER_INDEX(0), 18, 3376 }, { ZAP_CLUSTER_INDEX(18), 42, 6531 }, { ZAP_CLUSTER_INDEX(60), 3, 20 }, \ } // Largest attribute size is needed for various buffers @@ -2925,7 +2940,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (1518) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (9916) +#define ATTRIBUTE_MAX_SIZE (9927) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/app-common/app-common/zap-generated/af-structs.h b/zzz_generated/app-common/app-common/zap-generated/af-structs.h index c8fe0aec8c193e..9f16baeb22134f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/af-structs.h +++ b/zzz_generated/app-common/app-common/zap-generated/af-structs.h @@ -39,6 +39,23 @@ typedef struct _SimpleStruct uint8_t f; } SimpleStruct; +// Struct for NullablesAndOptionalsStruct +typedef struct _NullablesAndOptionalsStruct +{ + uint16_t NullableInt; + uint16_t OptionalInt; + uint16_t NullableOptionalInt; + chip::CharSpan NullableString; + chip::CharSpan OptionalString; + chip::CharSpan NullableOptionalString; + SimpleStruct NullableStruct; + SimpleStruct OptionalStruct; + SimpleStruct NullableOptionalStruct; + /* TYPE WARNING: array array defaults to */ uint8_t * NullableList; + /* TYPE WARNING: array array defaults to */ uint8_t * OptionalList; + /* TYPE WARNING: array array defaults to */ uint8_t * NullableOptionalList; +} NullablesAndOptionalsStruct; + // Struct for NestedStruct typedef struct _NestedStruct { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index bf5d95ffcda327..53e019b35b9ec5 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -38,14 +38,13 @@ namespace Attributes { namespace MainsVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * mainsVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) mainsVoltage, - sizeof(*mainsVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t mainsVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &mainsVoltage, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -53,14 +52,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t mainsVoltage) namespace MainsFrequency { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * mainsFrequency) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) mainsFrequency, - sizeof(*mainsFrequency)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t mainsFrequency) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &mainsFrequency, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -68,14 +66,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t mainsFrequency) namespace MainsAlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * mainsAlarmMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) mainsAlarmMask, - sizeof(*mainsAlarmMask)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t mainsAlarmMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &mainsAlarmMask, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -83,14 +80,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t mainsAlarmMask) namespace MainsVoltageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * mainsVoltageMinThreshold) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) mainsVoltageMinThreshold, - sizeof(*mainsVoltageMinThreshold)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t mainsVoltageMinThreshold) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &mainsVoltageMinThreshold, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -98,14 +94,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t mainsVoltageMinThreshold) namespace MainsVoltageMaxThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * mainsVoltageMaxThreshold) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) mainsVoltageMaxThreshold, - sizeof(*mainsVoltageMaxThreshold)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t mainsVoltageMaxThreshold) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &mainsVoltageMaxThreshold, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -113,14 +108,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t mainsVoltageMaxThreshold) namespace MainsVoltageDwellTrip { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * mainsVoltageDwellTrip) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) mainsVoltageDwellTrip, - sizeof(*mainsVoltageDwellTrip)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t mainsVoltageDwellTrip) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &mainsVoltageDwellTrip, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -128,14 +122,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t mainsVoltageDwellTrip) namespace BatteryVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryVoltage, - sizeof(*batteryVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryVoltage, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -143,29 +136,50 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltage) namespace BatteryPercentageRemaining { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryPercentageRemaining) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryPercentageRemaining, - sizeof(*batteryPercentageRemaining)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageRemaining) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryPercentageRemaining, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryPercentageRemaining +namespace BatteryManufacturer { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace BatteryManufacturer + namespace BatterySize { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batterySize) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batterySize, - sizeof(*batterySize)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batterySize) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batterySize, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -173,14 +187,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batterySize) namespace BatteryAhrRating { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * batteryAhrRating) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryAhrRating, - sizeof(*batteryAhrRating)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t batteryAhrRating) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryAhrRating, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -188,14 +201,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t batteryAhrRating) namespace BatteryQuantity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryQuantity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryQuantity, - sizeof(*batteryQuantity)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryQuantity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryQuantity, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -203,14 +215,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryQuantity) namespace BatteryRatedVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryRatedVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryRatedVoltage, - sizeof(*batteryRatedVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryRatedVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryRatedVoltage, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -218,14 +229,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryRatedVoltage) namespace BatteryAlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryAlarmMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryAlarmMask, - sizeof(*batteryAlarmMask)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryAlarmMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryAlarmMask, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -233,14 +243,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryAlarmMask) namespace BatteryVoltageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryVoltageMinThreshold) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryVoltageMinThreshold, - sizeof(*batteryVoltageMinThreshold)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltageMinThreshold) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryVoltageMinThreshold, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -248,14 +257,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltageMinThreshold) namespace BatteryVoltageThreshold1 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryVoltageThreshold1) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryVoltageThreshold1, - sizeof(*batteryVoltageThreshold1)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold1) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryVoltageThreshold1, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -263,14 +271,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold1) namespace BatteryVoltageThreshold2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryVoltageThreshold2) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryVoltageThreshold2, - sizeof(*batteryVoltageThreshold2)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold2) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryVoltageThreshold2, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -278,14 +285,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold2) namespace BatteryVoltageThreshold3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryVoltageThreshold3) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryVoltageThreshold3, - sizeof(*batteryVoltageThreshold3)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold3) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryVoltageThreshold3, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -293,14 +299,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold3) namespace BatteryPercentageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryPercentageMinThreshold) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryPercentageMinThreshold, - sizeof(*batteryPercentageMinThreshold)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageMinThreshold) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryPercentageMinThreshold, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -308,14 +313,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageMinThresho namespace BatteryPercentageThreshold1 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryPercentageThreshold1) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryPercentageThreshold1, - sizeof(*batteryPercentageThreshold1)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold1) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryPercentageThreshold1, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -323,14 +327,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold1 namespace BatteryPercentageThreshold2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryPercentageThreshold2) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryPercentageThreshold2, - sizeof(*batteryPercentageThreshold2)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold2) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryPercentageThreshold2, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -338,14 +341,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold2 namespace BatteryPercentageThreshold3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryPercentageThreshold3) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryPercentageThreshold3, - sizeof(*batteryPercentageThreshold3)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold3) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryPercentageThreshold3, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -353,14 +355,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold3 namespace BatteryAlarmState { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryAlarmState) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) batteryAlarmState, - sizeof(*batteryAlarmState)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryAlarmState) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &batteryAlarmState, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -368,14 +369,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryAlarmState) namespace Battery2Voltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2Voltage) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2Voltage, - sizeof(*battery2Voltage)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2Voltage) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2Voltage, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -383,29 +383,50 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2Voltage) namespace Battery2PercentageRemaining { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2PercentageRemaining) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2PercentageRemaining, - sizeof(*battery2PercentageRemaining)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageRemaining) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2PercentageRemaining, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery2PercentageRemaining +namespace Battery2Manufacturer { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace Battery2Manufacturer + namespace Battery2Size { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2Size) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2Size, - sizeof(*battery2Size)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2Size) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2Size, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -413,14 +434,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2Size) namespace Battery2AhrRating { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * battery2AhrRating) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2AhrRating, - sizeof(*battery2AhrRating)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t battery2AhrRating) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2AhrRating, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -428,14 +448,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t battery2AhrRating) namespace Battery2Quantity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2Quantity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2Quantity, - sizeof(*battery2Quantity)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2Quantity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2Quantity, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -443,14 +462,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2Quantity) namespace Battery2RatedVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2RatedVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2RatedVoltage, - sizeof(*battery2RatedVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2RatedVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2RatedVoltage, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -458,14 +476,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2RatedVoltage) namespace Battery2AlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2AlarmMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2AlarmMask, - sizeof(*battery2AlarmMask)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2AlarmMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2AlarmMask, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -473,14 +490,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2AlarmMask) namespace Battery2VoltageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2VoltageMinThreshold) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2VoltageMinThreshold, - sizeof(*battery2VoltageMinThreshold)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2VoltageMinThreshold) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2VoltageMinThreshold, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -488,14 +504,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2VoltageMinThreshold namespace Battery2VoltageThreshold1 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2VoltageThreshold1) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2VoltageThreshold1, - sizeof(*battery2VoltageThreshold1)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold1) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2VoltageThreshold1, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -503,14 +518,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold1) namespace Battery2VoltageThreshold2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2VoltageThreshold2) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2VoltageThreshold2, - sizeof(*battery2VoltageThreshold2)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold2) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2VoltageThreshold2, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -518,14 +532,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold2) namespace Battery2VoltageThreshold3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2VoltageThreshold3) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2VoltageThreshold3, - sizeof(*battery2VoltageThreshold3)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold3) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2VoltageThreshold3, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -533,14 +546,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold3) namespace Battery2PercentageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2PercentageMinThreshold) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2PercentageMinThreshold, - sizeof(*battery2PercentageMinThreshold)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageMinThreshold) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2PercentageMinThreshold, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -548,14 +560,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageMinThresh namespace Battery2PercentageThreshold1 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2PercentageThreshold1) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2PercentageThreshold1, - sizeof(*battery2PercentageThreshold1)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold1) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2PercentageThreshold1, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -563,14 +574,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold namespace Battery2PercentageThreshold2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2PercentageThreshold2) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2PercentageThreshold2, - sizeof(*battery2PercentageThreshold2)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold2) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2PercentageThreshold2, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -578,14 +588,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold namespace Battery2PercentageThreshold3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2PercentageThreshold3) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2PercentageThreshold3, - sizeof(*battery2PercentageThreshold3)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold3) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2PercentageThreshold3, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -593,14 +602,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold namespace Battery2AlarmState { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * battery2AlarmState) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery2AlarmState, - sizeof(*battery2AlarmState)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t battery2AlarmState) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery2AlarmState, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -608,14 +616,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t battery2AlarmState) namespace Battery3Voltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3Voltage) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3Voltage, - sizeof(*battery3Voltage)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3Voltage) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3Voltage, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -623,29 +630,50 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3Voltage) namespace Battery3PercentageRemaining { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3PercentageRemaining) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3PercentageRemaining, - sizeof(*battery3PercentageRemaining)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageRemaining) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3PercentageRemaining, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Battery3PercentageRemaining +namespace Battery3Manufacturer { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace Battery3Manufacturer + namespace Battery3Size { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3Size) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3Size, - sizeof(*battery3Size)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3Size) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3Size, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -653,14 +681,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3Size) namespace Battery3AhrRating { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * battery3AhrRating) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3AhrRating, - sizeof(*battery3AhrRating)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t battery3AhrRating) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3AhrRating, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -668,14 +695,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t battery3AhrRating) namespace Battery3Quantity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3Quantity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3Quantity, - sizeof(*battery3Quantity)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3Quantity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3Quantity, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -683,14 +709,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3Quantity) namespace Battery3RatedVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3RatedVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3RatedVoltage, - sizeof(*battery3RatedVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3RatedVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3RatedVoltage, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -698,14 +723,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3RatedVoltage) namespace Battery3AlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3AlarmMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3AlarmMask, - sizeof(*battery3AlarmMask)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3AlarmMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3AlarmMask, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -713,14 +737,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3AlarmMask) namespace Battery3VoltageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3VoltageMinThreshold) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3VoltageMinThreshold, - sizeof(*battery3VoltageMinThreshold)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3VoltageMinThreshold) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3VoltageMinThreshold, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -728,14 +751,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3VoltageMinThreshold namespace Battery3VoltageThreshold1 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3VoltageThreshold1) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3VoltageThreshold1, - sizeof(*battery3VoltageThreshold1)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold1) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3VoltageThreshold1, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -743,14 +765,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold1) namespace Battery3VoltageThreshold2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3VoltageThreshold2) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3VoltageThreshold2, - sizeof(*battery3VoltageThreshold2)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold2) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3VoltageThreshold2, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -758,14 +779,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold2) namespace Battery3VoltageThreshold3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3VoltageThreshold3) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3VoltageThreshold3, - sizeof(*battery3VoltageThreshold3)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold3) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3VoltageThreshold3, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -773,14 +793,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold3) namespace Battery3PercentageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3PercentageMinThreshold) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3PercentageMinThreshold, - sizeof(*battery3PercentageMinThreshold)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageMinThreshold) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3PercentageMinThreshold, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -788,14 +807,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageMinThresh namespace Battery3PercentageThreshold1 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3PercentageThreshold1) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3PercentageThreshold1, - sizeof(*battery3PercentageThreshold1)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold1) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3PercentageThreshold1, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -803,14 +821,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold namespace Battery3PercentageThreshold2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3PercentageThreshold2) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3PercentageThreshold2, - sizeof(*battery3PercentageThreshold2)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold2) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3PercentageThreshold2, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -818,14 +835,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold namespace Battery3PercentageThreshold3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3PercentageThreshold3) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3PercentageThreshold3, - sizeof(*battery3PercentageThreshold3)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold3) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3PercentageThreshold3, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -833,14 +849,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold namespace Battery3AlarmState { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * battery3AlarmState) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) battery3AlarmState, - sizeof(*battery3AlarmState)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t battery3AlarmState) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &battery3AlarmState, + return emberAfWriteServerAttribute(endpoint, Clusters::PowerConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -854,14 +869,14 @@ namespace Attributes { namespace CurrentTemperature { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * currentTemperature) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) currentTemperature, - sizeof(*currentTemperature)); + return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t currentTemperature) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) ¤tTemperature, + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -869,14 +884,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t currentTemperature) namespace MinTempExperienced { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minTempExperienced) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) minTempExperienced, - sizeof(*minTempExperienced)); + return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minTempExperienced) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &minTempExperienced, + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -884,14 +899,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t minTempExperienced) namespace MaxTempExperienced { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxTempExperienced) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) maxTempExperienced, - sizeof(*maxTempExperienced)); + return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxTempExperienced) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &maxTempExperienced, + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -899,14 +914,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxTempExperienced) namespace OverTempTotalDwell { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * overTempTotalDwell) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) overTempTotalDwell, - sizeof(*overTempTotalDwell)); + return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t overTempTotalDwell) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &overTempTotalDwell, + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -914,14 +929,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t overTempTotalDwell) namespace DeviceTempAlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * deviceTempAlarmMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) deviceTempAlarmMask, - sizeof(*deviceTempAlarmMask)); + return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t deviceTempAlarmMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &deviceTempAlarmMask, + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -929,14 +944,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t deviceTempAlarmMask) namespace LowTempThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * lowTempThreshold) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) lowTempThreshold, - sizeof(*lowTempThreshold)); + return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t lowTempThreshold) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &lowTempThreshold, + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -944,14 +959,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t lowTempThreshold) namespace HighTempThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * highTempThreshold) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) highTempThreshold, - sizeof(*highTempThreshold)); + return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t highTempThreshold) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &highTempThreshold, + return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -965,26 +980,26 @@ namespace Attributes { namespace IdentifyTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * identifyTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) identifyTime, sizeof(*identifyTime)); + return emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t identifyTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) &identifyTime, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace IdentifyTime namespace IdentifyType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * identifyType) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) identifyType, sizeof(*identifyType)); + return emberAfReadServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t identifyType) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) &identifyType, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Identify::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace IdentifyType @@ -997,13 +1012,13 @@ namespace Attributes { namespace NameSupport { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * nameSupport) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Groups::Id, Id, (uint8_t *) nameSupport, sizeof(*nameSupport)); + return emberAfReadServerAttribute(endpoint, Clusters::Groups::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t nameSupport) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Groups::Id, Id, (uint8_t *) &nameSupport, ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Groups::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace NameSupport @@ -1016,79 +1031,78 @@ namespace Attributes { namespace SceneCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * sceneCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) sceneCount, sizeof(*sceneCount)); + return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t sceneCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &sceneCount, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace SceneCount namespace CurrentScene { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentScene) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) currentScene, sizeof(*currentScene)); + return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentScene) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) ¤tScene, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentScene namespace CurrentGroup { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentGroup) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) currentGroup, sizeof(*currentGroup)); + return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentGroup) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) ¤tGroup, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentGroup namespace SceneValid { -EmberAfStatus Get(chip::EndpointId endpoint, bool * sceneValid) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) sceneValid, sizeof(*sceneValid)); + return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool sceneValid) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &sceneValid, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace SceneValid namespace NameSupport { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * nameSupport) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) nameSupport, sizeof(*nameSupport)); + return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t nameSupport) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &nameSupport, ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace NameSupport namespace LastConfiguredBy { -EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * lastConfiguredBy) +EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) lastConfiguredBy, sizeof(*lastConfiguredBy)); + return emberAfReadServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId lastConfiguredBy) +EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &lastConfiguredBy, - ZCL_NODE_ID_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Scenes::Id, Id, (uint8_t *) &value, ZCL_NODE_ID_ATTRIBUTE_TYPE); } } // namespace LastConfiguredBy @@ -1101,127 +1115,117 @@ namespace Attributes { namespace OnOff { -EmberAfStatus Get(chip::EndpointId endpoint, bool * onOff) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) onOff, sizeof(*onOff)); + return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool onOff) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &onOff, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace OnOff namespace SampleMfgSpecificAttribute0x00000x1002 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * sampleMfgSpecificAttribute0x00000x1002) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) sampleMfgSpecificAttribute0x00000x1002, - sizeof(*sampleMfgSpecificAttribute0x00000x1002)); + return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t sampleMfgSpecificAttribute0x00000x1002) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &sampleMfgSpecificAttribute0x00000x1002, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace SampleMfgSpecificAttribute0x00000x1002 namespace SampleMfgSpecificAttribute0x00000x1049 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * sampleMfgSpecificAttribute0x00000x1049) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) sampleMfgSpecificAttribute0x00000x1049, - sizeof(*sampleMfgSpecificAttribute0x00000x1049)); + return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t sampleMfgSpecificAttribute0x00000x1049) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &sampleMfgSpecificAttribute0x00000x1049, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace SampleMfgSpecificAttribute0x00000x1049 namespace SampleMfgSpecificAttribute0x00010x1002 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * sampleMfgSpecificAttribute0x00010x1002) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) sampleMfgSpecificAttribute0x00010x1002, - sizeof(*sampleMfgSpecificAttribute0x00010x1002)); + return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t sampleMfgSpecificAttribute0x00010x1002) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &sampleMfgSpecificAttribute0x00010x1002, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace SampleMfgSpecificAttribute0x00010x1002 namespace SampleMfgSpecificAttribute0x00010x1040 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * sampleMfgSpecificAttribute0x00010x1040) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) sampleMfgSpecificAttribute0x00010x1040, - sizeof(*sampleMfgSpecificAttribute0x00010x1040)); + return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t sampleMfgSpecificAttribute0x00010x1040) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &sampleMfgSpecificAttribute0x00010x1040, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace SampleMfgSpecificAttribute0x00010x1040 namespace GlobalSceneControl { -EmberAfStatus Get(chip::EndpointId endpoint, bool * globalSceneControl) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) globalSceneControl, - sizeof(*globalSceneControl)); + return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool globalSceneControl) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &globalSceneControl, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace GlobalSceneControl namespace OnTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * onTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) onTime, sizeof(*onTime)); + return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t onTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &onTime, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace OnTime namespace OffWaitTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * offWaitTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) offWaitTime, sizeof(*offWaitTime)); + return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t offWaitTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &offWaitTime, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace OffWaitTime namespace StartUpOnOff { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * startUpOnOff) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) startUpOnOff, sizeof(*startUpOnOff)); + return emberAfReadServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t startUpOnOff) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &startUpOnOff, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OnOff::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace StartUpOnOff @@ -1234,14 +1238,13 @@ namespace Attributes { namespace SwitchType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * switchType) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) switchType, - sizeof(*switchType)); + return emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t switchType) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) &switchType, + return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -1249,14 +1252,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t switchType) namespace SwitchActions { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * switchActions) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) switchActions, - sizeof(*switchActions)); + return emberAfReadServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t switchActions) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) &switchActions, + return emberAfWriteServerAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -1270,198 +1272,182 @@ namespace Attributes { namespace CurrentLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentLevel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) currentLevel, sizeof(*currentLevel)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentLevel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) ¤tLevel, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentLevel namespace RemainingTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * remainingTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) remainingTime, sizeof(*remainingTime)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t remainingTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &remainingTime, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RemainingTime namespace MinLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * minLevel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) minLevel, sizeof(*minLevel)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t minLevel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &minLevel, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MinLevel namespace MaxLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * maxLevel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) maxLevel, sizeof(*maxLevel)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t maxLevel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &maxLevel, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MaxLevel namespace CurrentFrequency { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentFrequency) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) currentFrequency, - sizeof(*currentFrequency)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentFrequency) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) ¤tFrequency, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentFrequency namespace MinFrequency { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * minFrequency) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) minFrequency, sizeof(*minFrequency)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minFrequency) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &minFrequency, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace MinFrequency namespace MaxFrequency { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxFrequency) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) maxFrequency, sizeof(*maxFrequency)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxFrequency) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &maxFrequency, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace MaxFrequency namespace Options { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * options) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) options, sizeof(*options)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t options) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &options, ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace Options namespace OnOffTransitionTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * onOffTransitionTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) onOffTransitionTime, - sizeof(*onOffTransitionTime)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t onOffTransitionTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &onOffTransitionTime, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace OnOffTransitionTime namespace OnLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * onLevel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) onLevel, sizeof(*onLevel)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t onLevel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &onLevel, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace OnLevel namespace OnTransitionTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * onTransitionTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) onTransitionTime, - sizeof(*onTransitionTime)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t onTransitionTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &onTransitionTime, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace OnTransitionTime namespace OffTransitionTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * offTransitionTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) offTransitionTime, - sizeof(*offTransitionTime)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t offTransitionTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &offTransitionTime, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace OffTransitionTime namespace DefaultMoveRate { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * defaultMoveRate) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) defaultMoveRate, - sizeof(*defaultMoveRate)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t defaultMoveRate) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &defaultMoveRate, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace DefaultMoveRate namespace StartUpCurrentLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * startUpCurrentLevel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) startUpCurrentLevel, - sizeof(*startUpCurrentLevel)); + return emberAfReadServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t startUpCurrentLevel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &startUpCurrentLevel, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::LevelControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace StartUpCurrentLevel @@ -1474,13 +1460,13 @@ namespace Attributes { namespace AlarmCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * alarmCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Alarms::Id, Id, (uint8_t *) alarmCount, sizeof(*alarmCount)); + return emberAfReadServerAttribute(endpoint, Clusters::Alarms::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t alarmCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Alarms::Id, Id, (uint8_t *) &alarmCount, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Alarms::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AlarmCount @@ -1493,130 +1479,130 @@ namespace Attributes { namespace Time { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * time) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) time, sizeof(*time)); + return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t time) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &time, ZCL_EPOCH_S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } } // namespace Time namespace TimeStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * timeStatus) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) timeStatus, sizeof(*timeStatus)); + return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t timeStatus) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &timeStatus, ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace TimeStatus namespace TimeZone { -EmberAfStatus Get(chip::EndpointId endpoint, int32_t * timeZone) +EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) timeZone, sizeof(*timeZone)); + return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int32_t timeZone) +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &timeZone, ZCL_INT32S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); } } // namespace TimeZone namespace DstStart { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * dstStart) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) dstStart, sizeof(*dstStart)); + return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t dstStart) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &dstStart, ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace DstStart namespace DstEnd { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * dstEnd) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) dstEnd, sizeof(*dstEnd)); + return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t dstEnd) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &dstEnd, ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace DstEnd namespace DstShift { -EmberAfStatus Get(chip::EndpointId endpoint, int32_t * dstShift) +EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) dstShift, sizeof(*dstShift)); + return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int32_t dstShift) +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &dstShift, ZCL_INT32S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); } } // namespace DstShift namespace StandardTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * standardTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) standardTime, sizeof(*standardTime)); + return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t standardTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &standardTime, ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace StandardTime namespace LocalTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * localTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) localTime, sizeof(*localTime)); + return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t localTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &localTime, ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace LocalTime namespace LastSetTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * lastSetTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) lastSetTime, sizeof(*lastSetTime)); + return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t lastSetTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &lastSetTime, ZCL_EPOCH_S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } } // namespace LastSetTime namespace ValidUntilTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * validUntilTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) validUntilTime, sizeof(*validUntilTime)); + return emberAfReadServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t validUntilTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &validUntilTime, ZCL_EPOCH_S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Time::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } } // namespace ValidUntilTime @@ -1627,16 +1613,84 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t validUntilTime) namespace BinaryInputBasic { namespace Attributes { +namespace ActiveText { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ActiveText + +namespace Description { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace Description + +namespace InactiveText { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace InactiveText + namespace OutOfService { -EmberAfStatus Get(chip::EndpointId endpoint, bool * outOfService) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) outOfService, - sizeof(*outOfService)); + return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool outOfService) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &outOfService, + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -1644,28 +1698,26 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool outOfService) namespace Polarity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * polarity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) polarity, sizeof(*polarity)); + return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t polarity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &polarity, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Polarity namespace PresentValue { -EmberAfStatus Get(chip::EndpointId endpoint, bool * presentValue) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) presentValue, - sizeof(*presentValue)); + return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool presentValue) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &presentValue, + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -1673,27 +1725,26 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool presentValue) namespace Reliability { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * reliability) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) reliability, sizeof(*reliability)); + return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t reliability) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &reliability, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Reliability namespace StatusFlags { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * statusFlags) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) statusFlags, sizeof(*statusFlags)); + return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t statusFlags) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &statusFlags, + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -1701,15 +1752,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t statusFlags) namespace ApplicationType { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * applicationType) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) applicationType, - sizeof(*applicationType)); + return emberAfReadServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t applicationType) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &applicationType, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace ApplicationType @@ -1722,73 +1771,65 @@ namespace Attributes { namespace TotalProfileNum { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * totalProfileNum) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) totalProfileNum, - sizeof(*totalProfileNum)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t totalProfileNum) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &totalProfileNum, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace TotalProfileNum namespace MultipleScheduling { -EmberAfStatus Get(chip::EndpointId endpoint, bool * multipleScheduling) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) multipleScheduling, - sizeof(*multipleScheduling)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool multipleScheduling) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &multipleScheduling, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace MultipleScheduling namespace EnergyFormatting { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * energyFormatting) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) energyFormatting, - sizeof(*energyFormatting)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t energyFormatting) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &energyFormatting, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace EnergyFormatting namespace EnergyRemote { -EmberAfStatus Get(chip::EndpointId endpoint, bool * energyRemote) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) energyRemote, sizeof(*energyRemote)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool energyRemote) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &energyRemote, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace EnergyRemote namespace ScheduleMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * scheduleMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) scheduleMode, sizeof(*scheduleMode)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t scheduleMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &scheduleMode, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerProfile::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace ScheduleMode @@ -1801,43 +1842,39 @@ namespace Attributes { namespace StartTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * startTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) startTime, sizeof(*startTime)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t startTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) &startTime, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace StartTime namespace FinishTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * finishTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) finishTime, sizeof(*finishTime)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t finishTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) &finishTime, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace FinishTime namespace RemainingTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * remainingTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) remainingTime, - sizeof(*remainingTime)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t remainingTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) &remainingTime, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RemainingTime @@ -1856,105 +1893,91 @@ namespace Attributes { namespace CheckInInterval { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * checkInInterval) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) checkInInterval, - sizeof(*checkInInterval)); + return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t checkInInterval) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &checkInInterval, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace CheckInInterval namespace LongPollInterval { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * longPollInterval) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) longPollInterval, - sizeof(*longPollInterval)); + return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t longPollInterval) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &longPollInterval, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace LongPollInterval namespace ShortPollInterval { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * shortPollInterval) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) shortPollInterval, - sizeof(*shortPollInterval)); + return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t shortPollInterval) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &shortPollInterval, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ShortPollInterval namespace FastPollTimeout { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * fastPollTimeout) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) fastPollTimeout, - sizeof(*fastPollTimeout)); + return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t fastPollTimeout) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &fastPollTimeout, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace FastPollTimeout namespace CheckInIntervalMin { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * checkInIntervalMin) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) checkInIntervalMin, - sizeof(*checkInIntervalMin)); + return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t checkInIntervalMin) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &checkInIntervalMin, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace CheckInIntervalMin namespace LongPollIntervalMin { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * longPollIntervalMin) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) longPollIntervalMin, - sizeof(*longPollIntervalMin)); + return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t longPollIntervalMin) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &longPollIntervalMin, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace LongPollIntervalMin namespace FastPollTimeoutMax { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * fastPollTimeoutMax) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) fastPollTimeoutMax, - sizeof(*fastPollTimeoutMax)); + return emberAfReadServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t fastPollTimeoutMax) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &fastPollTimeoutMax, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PollControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace FastPollTimeoutMax @@ -1967,95 +1990,344 @@ namespace Attributes { namespace InteractionModelVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * interactionModelVersion) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) interactionModelVersion, - sizeof(*interactionModelVersion)); + return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t interactionModelVersion) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &interactionModelVersion, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace InteractionModelVersion +namespace VendorName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace VendorName + namespace VendorID { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * vendorID) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) vendorID, sizeof(*vendorID)); + return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t vendorID) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &vendorID, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace VendorID +namespace ProductName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ProductName + namespace ProductID { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * productID) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) productID, sizeof(*productID)); + return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t productID) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &productID, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ProductID +namespace UserLabel { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace UserLabel + +namespace Location { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[2 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 2); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[2 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace Location + namespace HardwareVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * hardwareVersion) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) hardwareVersion, sizeof(*hardwareVersion)); + return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t hardwareVersion) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &hardwareVersion, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace HardwareVersion +namespace HardwareVersionString { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[64 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 64); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[64 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace HardwareVersionString + namespace SoftwareVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * softwareVersion) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) softwareVersion, sizeof(*softwareVersion)); + return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t softwareVersion) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &softwareVersion, ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace SoftwareVersion +namespace SoftwareVersionString { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[64 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 64); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[64 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace SoftwareVersionString + +namespace ManufacturingDate { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ManufacturingDate + +namespace PartNumber { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace PartNumber + +namespace ProductURL { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 256, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[256 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 256); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 256, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[256 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ProductURL + +namespace ProductLabel { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[64 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 64); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[64 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ProductLabel + +namespace SerialNumber { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace SerialNumber + namespace LocalConfigDisabled { -EmberAfStatus Get(chip::EndpointId endpoint, bool * localConfigDisabled) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) localConfigDisabled, - sizeof(*localConfigDisabled)); + return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool localConfigDisabled) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &localConfigDisabled, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace LocalConfigDisabled namespace Reachable { -EmberAfStatus Get(chip::EndpointId endpoint, bool * reachable) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) reachable, sizeof(*reachable)); + return emberAfReadServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool reachable) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &reachable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Basic::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace Reachable @@ -2066,16 +2338,40 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool reachable) namespace OtaSoftwareUpdateRequestor { namespace Attributes { +namespace DefaultOtaProvider { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, zclString, + ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace DefaultOtaProvider + namespace UpdatePossible { -EmberAfStatus Get(chip::EndpointId endpoint, bool * updatePossible) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, (uint8_t *) updatePossible, - sizeof(*updatePossible)); + return emberAfReadServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool updatePossible) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, (uint8_t *) &updatePossible, + return emberAfWriteServerAttribute(endpoint, Clusters::OtaSoftwareUpdateRequestor::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -2089,353 +2385,404 @@ namespace Attributes { namespace Status { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * status) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) status, sizeof(*status)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t status) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &status, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Status namespace Order { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * order) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) order, sizeof(*order)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t order) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &order, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Order +namespace Description { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 60, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[60 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 60); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 60, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[60 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace Description + namespace WiredAssessedInputVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * wiredAssessedInputVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) wiredAssessedInputVoltage, - sizeof(*wiredAssessedInputVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t wiredAssessedInputVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &wiredAssessedInputVoltage, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace WiredAssessedInputVoltage namespace WiredAssessedInputFrequency { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * wiredAssessedInputFrequency) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) wiredAssessedInputFrequency, - sizeof(*wiredAssessedInputFrequency)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t wiredAssessedInputFrequency) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &wiredAssessedInputFrequency, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace WiredAssessedInputFrequency namespace WiredCurrentType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * wiredCurrentType) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) wiredCurrentType, - sizeof(*wiredCurrentType)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t wiredCurrentType) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &wiredCurrentType, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace WiredCurrentType namespace WiredAssessedCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * wiredAssessedCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) wiredAssessedCurrent, - sizeof(*wiredAssessedCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t wiredAssessedCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &wiredAssessedCurrent, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace WiredAssessedCurrent namespace WiredNominalVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * wiredNominalVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) wiredNominalVoltage, - sizeof(*wiredNominalVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t wiredNominalVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &wiredNominalVoltage, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace WiredNominalVoltage namespace WiredMaximumCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * wiredMaximumCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) wiredMaximumCurrent, - sizeof(*wiredMaximumCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t wiredMaximumCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &wiredMaximumCurrent, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace WiredMaximumCurrent namespace WiredPresent { -EmberAfStatus Get(chip::EndpointId endpoint, bool * wiredPresent) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) wiredPresent, sizeof(*wiredPresent)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool wiredPresent) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &wiredPresent, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace WiredPresent namespace BatteryVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryVoltage, sizeof(*batteryVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryVoltage, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryVoltage namespace BatteryPercentRemaining { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryPercentRemaining) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryPercentRemaining, - sizeof(*batteryPercentRemaining)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentRemaining) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryPercentRemaining, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryPercentRemaining namespace BatteryTimeRemaining { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryTimeRemaining) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryTimeRemaining, - sizeof(*batteryTimeRemaining)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryTimeRemaining) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryTimeRemaining, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryTimeRemaining namespace BatteryChargeLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryChargeLevel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryChargeLevel, - sizeof(*batteryChargeLevel)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryChargeLevel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryChargeLevel, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace BatteryChargeLevel namespace BatteryReplacementNeeded { -EmberAfStatus Get(chip::EndpointId endpoint, bool * batteryReplacementNeeded) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryReplacementNeeded, - sizeof(*batteryReplacementNeeded)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool batteryReplacementNeeded) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryReplacementNeeded, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace BatteryReplacementNeeded namespace BatteryReplaceability { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryReplaceability) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryReplaceability, - sizeof(*batteryReplaceability)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryReplaceability) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryReplaceability, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace BatteryReplaceability namespace BatteryPresent { -EmberAfStatus Get(chip::EndpointId endpoint, bool * batteryPresent) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryPresent, sizeof(*batteryPresent)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool batteryPresent) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryPresent, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace BatteryPresent +namespace BatteryReplacementDescription { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 60, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[60 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 60); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 60, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[60 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace BatteryReplacementDescription + namespace BatteryCommonDesignation { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryCommonDesignation) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryCommonDesignation, - sizeof(*batteryCommonDesignation)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryCommonDesignation) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryCommonDesignation, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryCommonDesignation +namespace BatteryANSIDesignation { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 20, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[20 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 20); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 20, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[20 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace BatteryANSIDesignation + +namespace BatteryIECDesignation { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 20, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[20 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 20); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 20, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[20 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace BatteryIECDesignation + namespace BatteryApprovedChemistry { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryApprovedChemistry) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryApprovedChemistry, - sizeof(*batteryApprovedChemistry)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryApprovedChemistry) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryApprovedChemistry, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryApprovedChemistry namespace BatteryCapacity { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryCapacity) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryCapacity, - sizeof(*batteryCapacity)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryCapacity) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryCapacity, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryCapacity namespace BatteryQuantity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryQuantity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryQuantity, - sizeof(*batteryQuantity)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryQuantity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryQuantity, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BatteryQuantity namespace BatteryChargeState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryChargeState) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryChargeState, - sizeof(*batteryChargeState)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryChargeState) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryChargeState, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace BatteryChargeState namespace BatteryTimeToFullCharge { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryTimeToFullCharge) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryTimeToFullCharge, - sizeof(*batteryTimeToFullCharge)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryTimeToFullCharge) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryTimeToFullCharge, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryTimeToFullCharge namespace BatteryFunctionalWhileCharging { -EmberAfStatus Get(chip::EndpointId endpoint, bool * batteryFunctionalWhileCharging) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryFunctionalWhileCharging, - sizeof(*batteryFunctionalWhileCharging)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool batteryFunctionalWhileCharging) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryFunctionalWhileCharging, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace BatteryFunctionalWhileCharging namespace BatteryChargingCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryChargingCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) batteryChargingCurrent, - sizeof(*batteryChargingCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryChargingCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &batteryChargingCurrent, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::PowerSource::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace BatteryChargingCurrent @@ -2448,14 +2795,13 @@ namespace Attributes { namespace Breadcrumb { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * breadcrumb) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, (uint8_t *) breadcrumb, - sizeof(*breadcrumb)); + return emberAfReadServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t breadcrumb) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, (uint8_t *) &breadcrumb, + return emberAfWriteServerAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -2469,14 +2815,13 @@ namespace Attributes { namespace RebootCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rebootCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) rebootCount, - sizeof(*rebootCount)); + return emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rebootCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &rebootCount, + return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2484,13 +2829,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rebootCount) namespace UpTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * upTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) upTime, sizeof(*upTime)); + return emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t upTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &upTime, + return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -2498,14 +2843,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t upTime) namespace TotalOperationalHours { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * totalOperationalHours) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) totalOperationalHours, - sizeof(*totalOperationalHours)); + return emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t totalOperationalHours) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &totalOperationalHours, + return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2513,14 +2857,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t totalOperationalHours) namespace BootReasons { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * bootReasons) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) bootReasons, - sizeof(*bootReasons)); + return emberAfReadServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t bootReasons) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &bootReasons, + return emberAfWriteServerAttribute(endpoint, Clusters::GeneralDiagnostics::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -2534,14 +2877,13 @@ namespace Attributes { namespace CurrentHeapFree { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * currentHeapFree) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) currentHeapFree, - sizeof(*currentHeapFree)); + return emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t currentHeapFree) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) ¤tHeapFree, + return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -2549,14 +2891,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t currentHeapFree) namespace CurrentHeapUsed { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * currentHeapUsed) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) currentHeapUsed, - sizeof(*currentHeapUsed)); + return emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t currentHeapUsed) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) ¤tHeapUsed, + return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -2564,14 +2905,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t currentHeapUsed) namespace CurrentHeapHighWatermark { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * currentHeapHighWatermark) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) currentHeapHighWatermark, - sizeof(*currentHeapHighWatermark)); + return emberAfReadServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t currentHeapHighWatermark) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) ¤tHeapHighWatermark, + return emberAfWriteServerAttribute(endpoint, Clusters::SoftwareDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -2585,13 +2925,13 @@ namespace Attributes { namespace Channel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * channel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) channel, sizeof(*channel)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t channel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &channel, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -2599,28 +2939,52 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t channel) namespace RoutingRole { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * routingRole) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) routingRole, - sizeof(*routingRole)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t routingRole) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &routingRole, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace RoutingRole +namespace NetworkName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, zclString, + ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace NetworkName + namespace PanId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * panId) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) panId, sizeof(*panId)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t panId) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &panId, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2628,29 +2992,52 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t panId) namespace ExtendedPanId { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * extendedPanId) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) extendedPanId, - sizeof(*extendedPanId)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t extendedPanId) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &extendedPanId, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace ExtendedPanId +namespace MeshLocalPrefix { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 17, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[17 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 17); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 17, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[17 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, zclString, + ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace MeshLocalPrefix + namespace OverrunCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * overrunCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) overrunCount, - sizeof(*overrunCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t overrunCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &overrunCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -2658,14 +3045,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t overrunCount) namespace PartitionId { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * partitionId) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) partitionId, - sizeof(*partitionId)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t partitionId) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &partitionId, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2673,14 +3059,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t partitionId) namespace Weighting { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * weighting) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) weighting, - sizeof(*weighting)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t weighting) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &weighting, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -2688,14 +3073,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t weighting) namespace DataVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * dataVersion) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) dataVersion, - sizeof(*dataVersion)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dataVersion) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &dataVersion, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -2703,14 +3087,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dataVersion) namespace StableDataVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * stableDataVersion) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) stableDataVersion, - sizeof(*stableDataVersion)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t stableDataVersion) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &stableDataVersion, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -2718,14 +3101,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t stableDataVersion) namespace LeaderRouterId { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * leaderRouterId) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) leaderRouterId, - sizeof(*leaderRouterId)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t leaderRouterId) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &leaderRouterId, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -2733,14 +3115,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t leaderRouterId) namespace DetachedRoleCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * detachedRoleCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) detachedRoleCount, - sizeof(*detachedRoleCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t detachedRoleCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &detachedRoleCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2748,14 +3129,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t detachedRoleCount) namespace ChildRoleCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * childRoleCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) childRoleCount, - sizeof(*childRoleCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t childRoleCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &childRoleCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2763,14 +3143,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t childRoleCount) namespace RouterRoleCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * routerRoleCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) routerRoleCount, - sizeof(*routerRoleCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t routerRoleCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &routerRoleCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2778,14 +3157,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t routerRoleCount) namespace LeaderRoleCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * leaderRoleCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) leaderRoleCount, - sizeof(*leaderRoleCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t leaderRoleCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &leaderRoleCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2793,14 +3171,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t leaderRoleCount) namespace AttachAttemptCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * attachAttemptCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) attachAttemptCount, - sizeof(*attachAttemptCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t attachAttemptCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &attachAttemptCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2808,14 +3185,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t attachAttemptCount) namespace PartitionIdChangeCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * partitionIdChangeCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) partitionIdChangeCount, - sizeof(*partitionIdChangeCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t partitionIdChangeCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &partitionIdChangeCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2823,29 +3199,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t partitionIdChangeCount) namespace BetterPartitionAttachAttemptCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * betterPartitionAttachAttemptCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - (uint8_t *) betterPartitionAttachAttemptCount, sizeof(*betterPartitionAttachAttemptCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t betterPartitionAttachAttemptCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - (uint8_t *) &betterPartitionAttachAttemptCount, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BetterPartitionAttachAttemptCount namespace ParentChangeCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * parentChangeCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) parentChangeCount, - sizeof(*parentChangeCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t parentChangeCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &parentChangeCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -2853,14 +3227,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t parentChangeCount) namespace TxTotalCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txTotalCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txTotalCount, - sizeof(*txTotalCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txTotalCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txTotalCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2868,14 +3241,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txTotalCount) namespace TxUnicastCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txUnicastCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txUnicastCount, - sizeof(*txUnicastCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txUnicastCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txUnicastCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2883,14 +3255,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txUnicastCount) namespace TxBroadcastCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txBroadcastCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txBroadcastCount, - sizeof(*txBroadcastCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txBroadcastCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txBroadcastCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2898,14 +3269,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txBroadcastCount) namespace TxAckRequestedCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txAckRequestedCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txAckRequestedCount, - sizeof(*txAckRequestedCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txAckRequestedCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txAckRequestedCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2913,14 +3283,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txAckRequestedCount) namespace TxAckedCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txAckedCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txAckedCount, - sizeof(*txAckedCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txAckedCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txAckedCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2928,14 +3297,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txAckedCount) namespace TxNoAckRequestedCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txNoAckRequestedCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txNoAckRequestedCount, - sizeof(*txNoAckRequestedCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txNoAckRequestedCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txNoAckRequestedCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2943,14 +3311,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txNoAckRequestedCount) namespace TxDataCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txDataCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txDataCount, - sizeof(*txDataCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txDataCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txDataCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2958,14 +3325,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txDataCount) namespace TxDataPollCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txDataPollCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txDataPollCount, - sizeof(*txDataPollCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txDataPollCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txDataPollCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2973,14 +3339,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txDataPollCount) namespace TxBeaconCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txBeaconCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txBeaconCount, - sizeof(*txBeaconCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txBeaconCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txBeaconCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -2988,14 +3353,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txBeaconCount) namespace TxBeaconRequestCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txBeaconRequestCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txBeaconRequestCount, - sizeof(*txBeaconRequestCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txBeaconRequestCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txBeaconRequestCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3003,14 +3367,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txBeaconRequestCount) namespace TxOtherCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txOtherCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txOtherCount, - sizeof(*txOtherCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txOtherCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txOtherCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3018,14 +3381,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txOtherCount) namespace TxRetryCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txRetryCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txRetryCount, - sizeof(*txRetryCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txRetryCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txRetryCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3033,44 +3395,41 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txRetryCount) namespace TxDirectMaxRetryExpiryCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txDirectMaxRetryExpiryCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txDirectMaxRetryExpiryCount, - sizeof(*txDirectMaxRetryExpiryCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txDirectMaxRetryExpiryCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - (uint8_t *) &txDirectMaxRetryExpiryCount, ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, + ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxDirectMaxRetryExpiryCount namespace TxIndirectMaxRetryExpiryCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txIndirectMaxRetryExpiryCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - (uint8_t *) txIndirectMaxRetryExpiryCount, sizeof(*txIndirectMaxRetryExpiryCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txIndirectMaxRetryExpiryCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, - (uint8_t *) &txIndirectMaxRetryExpiryCount, ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, + ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace TxIndirectMaxRetryExpiryCount namespace TxErrCcaCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txErrCcaCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txErrCcaCount, - sizeof(*txErrCcaCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txErrCcaCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txErrCcaCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3078,14 +3437,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txErrCcaCount) namespace TxErrAbortCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txErrAbortCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txErrAbortCount, - sizeof(*txErrAbortCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txErrAbortCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txErrAbortCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3093,14 +3451,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txErrAbortCount) namespace TxErrBusyChannelCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txErrBusyChannelCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) txErrBusyChannelCount, - sizeof(*txErrBusyChannelCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txErrBusyChannelCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &txErrBusyChannelCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3108,14 +3465,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txErrBusyChannelCount) namespace RxTotalCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxTotalCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxTotalCount, - sizeof(*rxTotalCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxTotalCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxTotalCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3123,14 +3479,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxTotalCount) namespace RxUnicastCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxUnicastCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxUnicastCount, - sizeof(*rxUnicastCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxUnicastCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxUnicastCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3138,14 +3493,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxUnicastCount) namespace RxBroadcastCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxBroadcastCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxBroadcastCount, - sizeof(*rxBroadcastCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxBroadcastCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxBroadcastCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3153,14 +3507,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxBroadcastCount) namespace RxDataCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxDataCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxDataCount, - sizeof(*rxDataCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxDataCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxDataCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3168,14 +3521,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxDataCount) namespace RxDataPollCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxDataPollCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxDataPollCount, - sizeof(*rxDataPollCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxDataPollCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxDataPollCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3183,14 +3535,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxDataPollCount) namespace RxBeaconCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxBeaconCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxBeaconCount, - sizeof(*rxBeaconCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxBeaconCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxBeaconCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3198,14 +3549,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxBeaconCount) namespace RxBeaconRequestCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxBeaconRequestCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxBeaconRequestCount, - sizeof(*rxBeaconRequestCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxBeaconRequestCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxBeaconRequestCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3213,14 +3563,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxBeaconRequestCount) namespace RxOtherCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxOtherCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxOtherCount, - sizeof(*rxOtherCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxOtherCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxOtherCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3228,14 +3577,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxOtherCount) namespace RxAddressFilteredCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxAddressFilteredCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxAddressFilteredCount, - sizeof(*rxAddressFilteredCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxAddressFilteredCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxAddressFilteredCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3243,14 +3591,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxAddressFilteredCount) namespace RxDestAddrFilteredCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxDestAddrFilteredCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxDestAddrFilteredCount, - sizeof(*rxDestAddrFilteredCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxDestAddrFilteredCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxDestAddrFilteredCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3258,14 +3605,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxDestAddrFilteredCount) namespace RxDuplicatedCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxDuplicatedCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxDuplicatedCount, - sizeof(*rxDuplicatedCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxDuplicatedCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxDuplicatedCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3273,14 +3619,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxDuplicatedCount) namespace RxErrNoFrameCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxErrNoFrameCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxErrNoFrameCount, - sizeof(*rxErrNoFrameCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrNoFrameCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxErrNoFrameCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3288,14 +3633,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrNoFrameCount) namespace RxErrUnknownNeighborCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxErrUnknownNeighborCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxErrUnknownNeighborCount, - sizeof(*rxErrUnknownNeighborCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrUnknownNeighborCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxErrUnknownNeighborCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3303,14 +3647,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrUnknownNeighborCount) namespace RxErrInvalidSrcAddrCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxErrInvalidSrcAddrCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxErrInvalidSrcAddrCount, - sizeof(*rxErrInvalidSrcAddrCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrInvalidSrcAddrCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxErrInvalidSrcAddrCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3318,14 +3661,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrInvalidSrcAddrCount) namespace RxErrSecCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxErrSecCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxErrSecCount, - sizeof(*rxErrSecCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrSecCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxErrSecCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3333,14 +3675,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrSecCount) namespace RxErrFcsCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxErrFcsCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxErrFcsCount, - sizeof(*rxErrFcsCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrFcsCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxErrFcsCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3348,14 +3689,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrFcsCount) namespace RxErrOtherCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxErrOtherCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) rxErrOtherCount, - sizeof(*rxErrOtherCount)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrOtherCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &rxErrOtherCount, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3363,14 +3703,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrOtherCount) namespace ActiveTimestamp { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * activeTimestamp) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) activeTimestamp, - sizeof(*activeTimestamp)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t activeTimestamp) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &activeTimestamp, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3378,14 +3717,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t activeTimestamp) namespace PendingTimestamp { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * pendingTimestamp) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) pendingTimestamp, - sizeof(*pendingTimestamp)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t pendingTimestamp) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &pendingTimestamp, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3393,34 +3731,83 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t pendingTimestamp) namespace Delay { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * delay) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) delay, sizeof(*delay)); + return emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t delay) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &delay, + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace Delay +namespace ChannelMask { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 4, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[4 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 4); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 4, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[4 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ThreadNetworkDiagnostics::Id, Id, zclString, + ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ChannelMask + } // namespace Attributes } // namespace ThreadNetworkDiagnostics namespace WiFiNetworkDiagnostics { namespace Attributes { +namespace Bssid { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[6 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 6); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[6 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, zclString, + ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace Bssid + namespace SecurityType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * securityType) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) securityType, - sizeof(*securityType)); + return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t securityType) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &securityType, + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -3428,14 +3815,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t securityType) namespace WiFiVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * wiFiVersion) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) wiFiVersion, - sizeof(*wiFiVersion)); + return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t wiFiVersion) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &wiFiVersion, + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -3443,14 +3829,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t wiFiVersion) namespace ChannelNumber { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * channelNumber) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) channelNumber, - sizeof(*channelNumber)); + return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t channelNumber) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &channelNumber, + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3458,13 +3843,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t channelNumber) namespace Rssi { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * rssi) +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) rssi, sizeof(*rssi)); + return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int8_t rssi) +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &rssi, + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -3472,14 +3857,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t rssi) namespace BeaconLostCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * beaconLostCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) beaconLostCount, - sizeof(*beaconLostCount)); + return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t beaconLostCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &beaconLostCount, + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3487,14 +3871,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t beaconLostCount) namespace BeaconRxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * beaconRxCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) beaconRxCount, - sizeof(*beaconRxCount)); + return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t beaconRxCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &beaconRxCount, + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3502,14 +3885,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t beaconRxCount) namespace PacketMulticastRxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * packetMulticastRxCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) packetMulticastRxCount, - sizeof(*packetMulticastRxCount)); + return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t packetMulticastRxCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &packetMulticastRxCount, + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3517,14 +3899,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t packetMulticastRxCount) namespace PacketMulticastTxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * packetMulticastTxCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) packetMulticastTxCount, - sizeof(*packetMulticastTxCount)); + return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t packetMulticastTxCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &packetMulticastTxCount, + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3532,14 +3913,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t packetMulticastTxCount) namespace PacketUnicastRxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * packetUnicastRxCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) packetUnicastRxCount, - sizeof(*packetUnicastRxCount)); + return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t packetUnicastRxCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &packetUnicastRxCount, + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3547,14 +3927,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t packetUnicastRxCount) namespace PacketUnicastTxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * packetUnicastTxCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) packetUnicastTxCount, - sizeof(*packetUnicastTxCount)); + return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t packetUnicastTxCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &packetUnicastTxCount, + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -3562,14 +3941,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t packetUnicastTxCount) namespace CurrentMaxRate { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * currentMaxRate) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) currentMaxRate, - sizeof(*currentMaxRate)); + return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t currentMaxRate) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) ¤tMaxRate, + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3577,14 +3955,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t currentMaxRate) namespace OverrunCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * overrunCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) overrunCount, - sizeof(*overrunCount)); + return emberAfReadServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t overrunCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &overrunCount, + return emberAfWriteServerAttribute(endpoint, Clusters::WiFiNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3598,14 +3975,13 @@ namespace Attributes { namespace PHYRate { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * PHYRate) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) PHYRate, - sizeof(*PHYRate)); + return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t PHYRate) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &PHYRate, + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -3613,14 +3989,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t PHYRate) namespace FullDuplex { -EmberAfStatus Get(chip::EndpointId endpoint, bool * fullDuplex) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) fullDuplex, - sizeof(*fullDuplex)); + return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool fullDuplex) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &fullDuplex, + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -3628,14 +4003,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool fullDuplex) namespace PacketRxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * packetRxCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) packetRxCount, - sizeof(*packetRxCount)); + return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t packetRxCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &packetRxCount, + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3643,14 +4017,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t packetRxCount) namespace PacketTxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * packetTxCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) packetTxCount, - sizeof(*packetTxCount)); + return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t packetTxCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &packetTxCount, + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3658,14 +4031,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t packetTxCount) namespace TxErrCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * txErrCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) txErrCount, - sizeof(*txErrCount)); + return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t txErrCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &txErrCount, + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3673,14 +4045,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t txErrCount) namespace CollisionCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * collisionCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) collisionCount, - sizeof(*collisionCount)); + return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t collisionCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &collisionCount, + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3688,14 +4059,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t collisionCount) namespace OverrunCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * overrunCount) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) overrunCount, - sizeof(*overrunCount)); + return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t overrunCount) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &overrunCount, + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3703,14 +4073,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t overrunCount) namespace CarrierDetect { -EmberAfStatus Get(chip::EndpointId endpoint, bool * carrierDetect) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) carrierDetect, - sizeof(*carrierDetect)); + return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool carrierDetect) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &carrierDetect, + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -3718,14 +4087,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool carrierDetect) namespace TimeSinceReset { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * timeSinceReset) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) timeSinceReset, - sizeof(*timeSinceReset)); + return emberAfReadServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t timeSinceReset) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &timeSinceReset, + return emberAfWriteServerAttribute(endpoint, Clusters::EthernetNetworkDiagnostics::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } @@ -3737,59 +4105,287 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t timeSinceReset) namespace BridgedDeviceBasic { namespace Attributes { +namespace VendorName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace VendorName + namespace VendorID { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * vendorID) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) vendorID, sizeof(*vendorID)); + return emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t vendorID) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &vendorID, + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace VendorID +namespace ProductName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ProductName + +namespace UserLabel { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace UserLabel + namespace HardwareVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * hardwareVersion) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) hardwareVersion, - sizeof(*hardwareVersion)); + return emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t hardwareVersion) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &hardwareVersion, + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace HardwareVersion +namespace HardwareVersionString { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[64 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 64); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[64 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace HardwareVersionString + namespace SoftwareVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * softwareVersion) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) softwareVersion, - sizeof(*softwareVersion)); + return emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t softwareVersion) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &softwareVersion, + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace SoftwareVersion +namespace SoftwareVersionString { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[64 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 64); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[64 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace SoftwareVersionString + +namespace ManufacturingDate { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ManufacturingDate + +namespace PartNumber { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[254 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 254); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[254 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace PartNumber + +namespace ProductURL { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[254 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 254); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[254 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ProductURL + +namespace ProductLabel { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[64 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 64); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 64, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[64 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ProductLabel + +namespace SerialNumber { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace SerialNumber + namespace Reachable { -EmberAfStatus Get(chip::EndpointId endpoint, bool * reachable) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) reachable, sizeof(*reachable)); + return emberAfReadServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool reachable) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &reachable, + return emberAfWriteServerAttribute(endpoint, Clusters::BridgedDeviceBasic::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -3803,41 +4399,39 @@ namespace Attributes { namespace NumberOfPositions { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numberOfPositions) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) numberOfPositions, - sizeof(*numberOfPositions)); + return emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numberOfPositions) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) &numberOfPositions, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumberOfPositions namespace CurrentPosition { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentPosition) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) currentPosition, sizeof(*currentPosition)); + return emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentPosition) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) ¤tPosition, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentPosition namespace MultiPressMax { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * multiPressMax) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) multiPressMax, sizeof(*multiPressMax)); + return emberAfReadServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t multiPressMax) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) &multiPressMax, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Switch::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MultiPressMax @@ -3850,14 +4444,13 @@ namespace Attributes { namespace SupportedFabrics { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * supportedFabrics) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) supportedFabrics, - sizeof(*supportedFabrics)); + return emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t supportedFabrics) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) &supportedFabrics, + return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -3865,14 +4458,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t supportedFabrics) namespace CommissionedFabrics { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * commissionedFabrics) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) commissionedFabrics, - sizeof(*commissionedFabrics)); + return emberAfReadServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t commissionedFabrics) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) &commissionedFabrics, + return emberAfWriteServerAttribute(endpoint, Clusters::OperationalCredentials::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -3892,14 +4484,13 @@ namespace Attributes { namespace StateValue { -EmberAfStatus Get(chip::EndpointId endpoint, bool * stateValue) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BooleanState::Id, Id, (uint8_t *) stateValue, sizeof(*stateValue)); + return emberAfReadServerAttribute(endpoint, Clusters::BooleanState::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool stateValue) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BooleanState::Id, Id, (uint8_t *) &stateValue, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BooleanState::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace StateValue @@ -3912,14 +4503,13 @@ namespace Attributes { namespace PhysicalClosedLimit { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * physicalClosedLimit) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) physicalClosedLimit, - sizeof(*physicalClosedLimit)); + return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t physicalClosedLimit) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &physicalClosedLimit, + return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3927,14 +4517,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t physicalClosedLimit) namespace MotorStepSize { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * motorStepSize) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) motorStepSize, - sizeof(*motorStepSize)); + return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t motorStepSize) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &motorStepSize, + return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -3942,13 +4531,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t motorStepSize) namespace Status { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * status) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) status, sizeof(*status)); + return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t status) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &status, + return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -3956,14 +4545,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t status) namespace ClosedLimit { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * closedLimit) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) closedLimit, - sizeof(*closedLimit)); + return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t closedLimit) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &closedLimit, + return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -3971,13 +4559,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t closedLimit) namespace Mode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * mode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) mode, sizeof(*mode)); + return emberAfReadServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t mode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &mode, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ShadeConfiguration::Id, Id, (uint8_t *) &value, + ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Mode @@ -3990,606 +4579,569 @@ namespace Attributes { namespace LockState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * lockState) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) lockState, sizeof(*lockState)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lockState) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &lockState, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace LockState namespace LockType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * lockType) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) lockType, sizeof(*lockType)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lockType) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &lockType, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace LockType namespace ActuatorEnabled { -EmberAfStatus Get(chip::EndpointId endpoint, bool * actuatorEnabled) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) actuatorEnabled, sizeof(*actuatorEnabled)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool actuatorEnabled) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &actuatorEnabled, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace ActuatorEnabled namespace DoorState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * doorState) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) doorState, sizeof(*doorState)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t doorState) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &doorState, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace DoorState namespace DoorOpenEvents { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * doorOpenEvents) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) doorOpenEvents, sizeof(*doorOpenEvents)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t doorOpenEvents) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &doorOpenEvents, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace DoorOpenEvents namespace DoorClosedEvents { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * doorClosedEvents) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) doorClosedEvents, - sizeof(*doorClosedEvents)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t doorClosedEvents) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &doorClosedEvents, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace DoorClosedEvents namespace OpenPeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * openPeriod) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) openPeriod, sizeof(*openPeriod)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t openPeriod) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &openPeriod, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace OpenPeriod namespace NumLockRecordsSupported { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * numLockRecordsSupported) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) numLockRecordsSupported, - sizeof(*numLockRecordsSupported)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t numLockRecordsSupported) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &numLockRecordsSupported, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace NumLockRecordsSupported namespace NumTotalUsersSupported { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * numTotalUsersSupported) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) numTotalUsersSupported, - sizeof(*numTotalUsersSupported)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t numTotalUsersSupported) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &numTotalUsersSupported, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace NumTotalUsersSupported namespace NumPinUsersSupported { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * numPinUsersSupported) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) numPinUsersSupported, - sizeof(*numPinUsersSupported)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t numPinUsersSupported) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &numPinUsersSupported, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace NumPinUsersSupported namespace NumRfidUsersSupported { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * numRfidUsersSupported) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) numRfidUsersSupported, - sizeof(*numRfidUsersSupported)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t numRfidUsersSupported) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &numRfidUsersSupported, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace NumRfidUsersSupported namespace NumWeekdaySchedulesSupportedPerUser { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numWeekdaySchedulesSupportedPerUser) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) numWeekdaySchedulesSupportedPerUser, - sizeof(*numWeekdaySchedulesSupportedPerUser)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numWeekdaySchedulesSupportedPerUser) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &numWeekdaySchedulesSupportedPerUser, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumWeekdaySchedulesSupportedPerUser namespace NumYeardaySchedulesSupportedPerUser { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numYeardaySchedulesSupportedPerUser) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) numYeardaySchedulesSupportedPerUser, - sizeof(*numYeardaySchedulesSupportedPerUser)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numYeardaySchedulesSupportedPerUser) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &numYeardaySchedulesSupportedPerUser, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumYeardaySchedulesSupportedPerUser namespace NumHolidaySchedulesSupportedPerUser { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numHolidaySchedulesSupportedPerUser) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) numHolidaySchedulesSupportedPerUser, - sizeof(*numHolidaySchedulesSupportedPerUser)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numHolidaySchedulesSupportedPerUser) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &numHolidaySchedulesSupportedPerUser, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumHolidaySchedulesSupportedPerUser namespace MaxPinLength { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * maxPinLength) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) maxPinLength, sizeof(*maxPinLength)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t maxPinLength) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &maxPinLength, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MaxPinLength namespace MinPinLength { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * minPinLength) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) minPinLength, sizeof(*minPinLength)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t minPinLength) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &minPinLength, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MinPinLength namespace MaxRfidCodeLength { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * maxRfidCodeLength) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) maxRfidCodeLength, - sizeof(*maxRfidCodeLength)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t maxRfidCodeLength) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &maxRfidCodeLength, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MaxRfidCodeLength namespace MinRfidCodeLength { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * minRfidCodeLength) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) minRfidCodeLength, - sizeof(*minRfidCodeLength)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t minRfidCodeLength) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &minRfidCodeLength, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace MinRfidCodeLength namespace EnableLogging { -EmberAfStatus Get(chip::EndpointId endpoint, bool * enableLogging) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) enableLogging, sizeof(*enableLogging)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool enableLogging) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &enableLogging, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace EnableLogging +namespace Language { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[2 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 2); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[2 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace Language + namespace LedSettings { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * ledSettings) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) ledSettings, sizeof(*ledSettings)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t ledSettings) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &ledSettings, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace LedSettings namespace AutoRelockTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * autoRelockTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) autoRelockTime, sizeof(*autoRelockTime)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t autoRelockTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &autoRelockTime, - ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace AutoRelockTime namespace SoundVolume { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * soundVolume) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) soundVolume, sizeof(*soundVolume)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t soundVolume) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &soundVolume, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace SoundVolume namespace OperatingMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * operatingMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) operatingMode, sizeof(*operatingMode)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t operatingMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &operatingMode, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace OperatingMode namespace SupportedOperatingModes { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * supportedOperatingModes) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) supportedOperatingModes, - sizeof(*supportedOperatingModes)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t supportedOperatingModes) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &supportedOperatingModes, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace SupportedOperatingModes namespace DefaultConfigurationRegister { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * defaultConfigurationRegister) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) defaultConfigurationRegister, - sizeof(*defaultConfigurationRegister)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t defaultConfigurationRegister) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &defaultConfigurationRegister, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace DefaultConfigurationRegister namespace EnableLocalProgramming { -EmberAfStatus Get(chip::EndpointId endpoint, bool * enableLocalProgramming) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) enableLocalProgramming, - sizeof(*enableLocalProgramming)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool enableLocalProgramming) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &enableLocalProgramming, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace EnableLocalProgramming namespace EnableOneTouchLocking { -EmberAfStatus Get(chip::EndpointId endpoint, bool * enableOneTouchLocking) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) enableOneTouchLocking, - sizeof(*enableOneTouchLocking)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool enableOneTouchLocking) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &enableOneTouchLocking, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace EnableOneTouchLocking namespace EnableInsideStatusLed { -EmberAfStatus Get(chip::EndpointId endpoint, bool * enableInsideStatusLed) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) enableInsideStatusLed, - sizeof(*enableInsideStatusLed)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool enableInsideStatusLed) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &enableInsideStatusLed, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace EnableInsideStatusLed namespace EnablePrivacyModeButton { -EmberAfStatus Get(chip::EndpointId endpoint, bool * enablePrivacyModeButton) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) enablePrivacyModeButton, - sizeof(*enablePrivacyModeButton)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool enablePrivacyModeButton) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &enablePrivacyModeButton, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace EnablePrivacyModeButton namespace WrongCodeEntryLimit { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * wrongCodeEntryLimit) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) wrongCodeEntryLimit, - sizeof(*wrongCodeEntryLimit)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t wrongCodeEntryLimit) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &wrongCodeEntryLimit, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace WrongCodeEntryLimit namespace UserCodeTemporaryDisableTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * userCodeTemporaryDisableTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) userCodeTemporaryDisableTime, - sizeof(*userCodeTemporaryDisableTime)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t userCodeTemporaryDisableTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &userCodeTemporaryDisableTime, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace UserCodeTemporaryDisableTime namespace SendPinOverTheAir { -EmberAfStatus Get(chip::EndpointId endpoint, bool * sendPinOverTheAir) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) sendPinOverTheAir, - sizeof(*sendPinOverTheAir)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool sendPinOverTheAir) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &sendPinOverTheAir, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace SendPinOverTheAir namespace RequirePinForRfOperation { -EmberAfStatus Get(chip::EndpointId endpoint, bool * requirePinForRfOperation) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) requirePinForRfOperation, - sizeof(*requirePinForRfOperation)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool requirePinForRfOperation) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &requirePinForRfOperation, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace RequirePinForRfOperation namespace ZigbeeSecurityLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * zigbeeSecurityLevel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) zigbeeSecurityLevel, - sizeof(*zigbeeSecurityLevel)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t zigbeeSecurityLevel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &zigbeeSecurityLevel, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ZigbeeSecurityLevel namespace AlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * alarmMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) alarmMask, sizeof(*alarmMask)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t alarmMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &alarmMask, ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace AlarmMask namespace KeypadOperationEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * keypadOperationEventMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) keypadOperationEventMask, - sizeof(*keypadOperationEventMask)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t keypadOperationEventMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &keypadOperationEventMask, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace KeypadOperationEventMask namespace RfOperationEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rfOperationEventMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) rfOperationEventMask, - sizeof(*rfOperationEventMask)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rfOperationEventMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &rfOperationEventMask, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace RfOperationEventMask namespace ManualOperationEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * manualOperationEventMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) manualOperationEventMask, - sizeof(*manualOperationEventMask)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t manualOperationEventMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &manualOperationEventMask, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace ManualOperationEventMask namespace RfidOperationEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rfidOperationEventMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) rfidOperationEventMask, - sizeof(*rfidOperationEventMask)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rfidOperationEventMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &rfidOperationEventMask, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace RfidOperationEventMask namespace KeypadProgrammingEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * keypadProgrammingEventMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) keypadProgrammingEventMask, - sizeof(*keypadProgrammingEventMask)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t keypadProgrammingEventMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &keypadProgrammingEventMask, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace KeypadProgrammingEventMask namespace RfProgrammingEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rfProgrammingEventMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) rfProgrammingEventMask, - sizeof(*rfProgrammingEventMask)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rfProgrammingEventMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &rfProgrammingEventMask, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace RfProgrammingEventMask namespace RfidProgrammingEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rfidProgrammingEventMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) rfidProgrammingEventMask, - sizeof(*rfidProgrammingEventMask)); + return emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rfidProgrammingEventMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &rfidProgrammingEventMask, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DoorLock::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace RfidProgrammingEventMask @@ -4602,368 +5154,371 @@ namespace Attributes { namespace Type { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * type) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) type, sizeof(*type)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t type) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &type, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Type namespace PhysicalClosedLimitLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * physicalClosedLimitLift) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) physicalClosedLimitLift, - sizeof(*physicalClosedLimitLift)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t physicalClosedLimitLift) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &physicalClosedLimitLift, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PhysicalClosedLimitLift namespace PhysicalClosedLimitTilt { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * physicalClosedLimitTilt) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) physicalClosedLimitTilt, - sizeof(*physicalClosedLimitTilt)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t physicalClosedLimitTilt) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &physicalClosedLimitTilt, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PhysicalClosedLimitTilt namespace CurrentPositionLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentPositionLift) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) currentPositionLift, - sizeof(*currentPositionLift)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentPositionLift) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) ¤tPositionLift, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentPositionLift namespace CurrentPositionTilt { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentPositionTilt) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) currentPositionTilt, - sizeof(*currentPositionTilt)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentPositionTilt) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) ¤tPositionTilt, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentPositionTilt namespace NumberOfActuationsLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * numberOfActuationsLift) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) numberOfActuationsLift, - sizeof(*numberOfActuationsLift)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t numberOfActuationsLift) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &numberOfActuationsLift, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace NumberOfActuationsLift namespace NumberOfActuationsTilt { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * numberOfActuationsTilt) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) numberOfActuationsTilt, - sizeof(*numberOfActuationsTilt)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t numberOfActuationsTilt) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &numberOfActuationsTilt, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace NumberOfActuationsTilt namespace ConfigStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * configStatus) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) configStatus, sizeof(*configStatus)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t configStatus) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &configStatus, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace ConfigStatus namespace CurrentPositionLiftPercentage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentPositionLiftPercentage) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) currentPositionLiftPercentage, - sizeof(*currentPositionLiftPercentage)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentPositionLiftPercentage) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) ¤tPositionLiftPercentage, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentPositionLiftPercentage namespace CurrentPositionTiltPercentage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentPositionTiltPercentage) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) currentPositionTiltPercentage, - sizeof(*currentPositionTiltPercentage)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentPositionTiltPercentage) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) ¤tPositionTiltPercentage, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentPositionTiltPercentage namespace OperationalStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * operationalStatus) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) operationalStatus, - sizeof(*operationalStatus)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t operationalStatus) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &operationalStatus, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace OperationalStatus namespace TargetPositionLiftPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * targetPositionLiftPercent100ths) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) targetPositionLiftPercent100ths, - sizeof(*targetPositionLiftPercent100ths)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t targetPositionLiftPercent100ths) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &targetPositionLiftPercent100ths, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace TargetPositionLiftPercent100ths namespace TargetPositionTiltPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * targetPositionTiltPercent100ths) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) targetPositionTiltPercent100ths, - sizeof(*targetPositionTiltPercent100ths)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t targetPositionTiltPercent100ths) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &targetPositionTiltPercent100ths, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace TargetPositionTiltPercent100ths namespace EndProductType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * endProductType) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) endProductType, - sizeof(*endProductType)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t endProductType) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &endProductType, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace EndProductType namespace CurrentPositionLiftPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentPositionLiftPercent100ths) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) currentPositionLiftPercent100ths, - sizeof(*currentPositionLiftPercent100ths)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentPositionLiftPercent100ths) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) ¤tPositionLiftPercent100ths, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentPositionLiftPercent100ths namespace CurrentPositionTiltPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentPositionTiltPercent100ths) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) currentPositionTiltPercent100ths, - sizeof(*currentPositionTiltPercent100ths)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentPositionTiltPercent100ths) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) ¤tPositionTiltPercent100ths, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentPositionTiltPercent100ths namespace InstalledOpenLimitLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * installedOpenLimitLift) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) installedOpenLimitLift, - sizeof(*installedOpenLimitLift)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t installedOpenLimitLift) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &installedOpenLimitLift, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace InstalledOpenLimitLift namespace InstalledClosedLimitLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * installedClosedLimitLift) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) installedClosedLimitLift, - sizeof(*installedClosedLimitLift)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t installedClosedLimitLift) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &installedClosedLimitLift, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace InstalledClosedLimitLift namespace InstalledOpenLimitTilt { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * installedOpenLimitTilt) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) installedOpenLimitTilt, - sizeof(*installedOpenLimitTilt)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t installedOpenLimitTilt) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &installedOpenLimitTilt, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace InstalledOpenLimitTilt namespace InstalledClosedLimitTilt { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * installedClosedLimitTilt) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) installedClosedLimitTilt, - sizeof(*installedClosedLimitTilt)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t installedClosedLimitTilt) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &installedClosedLimitTilt, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace InstalledClosedLimitTilt namespace VelocityLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * velocityLift) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) velocityLift, sizeof(*velocityLift)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t velocityLift) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &velocityLift, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace VelocityLift namespace AccelerationTimeLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * accelerationTimeLift) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) accelerationTimeLift, - sizeof(*accelerationTimeLift)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t accelerationTimeLift) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &accelerationTimeLift, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AccelerationTimeLift namespace DecelerationTimeLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * decelerationTimeLift) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) decelerationTimeLift, - sizeof(*decelerationTimeLift)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t decelerationTimeLift) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &decelerationTimeLift, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace DecelerationTimeLift namespace Mode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * mode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) mode, sizeof(*mode)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t mode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &mode, ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace Mode +namespace IntermediateSetpointsLift { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[254 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 254); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[254 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace IntermediateSetpointsLift + +namespace IntermediateSetpointsTilt { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[254 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 254); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[254 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace IntermediateSetpointsTilt + namespace SafetyStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * safetyStatus) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) safetyStatus, sizeof(*safetyStatus)); + return emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t safetyStatus) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &safetyStatus, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace SafetyStatus @@ -4976,150 +5531,130 @@ namespace Attributes { namespace BarrierMovingState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * barrierMovingState) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) barrierMovingState, - sizeof(*barrierMovingState)); + return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t barrierMovingState) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &barrierMovingState, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace BarrierMovingState namespace BarrierSafetyStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierSafetyStatus) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) barrierSafetyStatus, - sizeof(*barrierSafetyStatus)); + return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierSafetyStatus) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &barrierSafetyStatus, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace BarrierSafetyStatus namespace BarrierCapabilities { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * barrierCapabilities) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) barrierCapabilities, - sizeof(*barrierCapabilities)); + return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t barrierCapabilities) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &barrierCapabilities, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace BarrierCapabilities namespace BarrierOpenEvents { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierOpenEvents) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) barrierOpenEvents, - sizeof(*barrierOpenEvents)); + return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierOpenEvents) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &barrierOpenEvents, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BarrierOpenEvents namespace BarrierCloseEvents { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierCloseEvents) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) barrierCloseEvents, - sizeof(*barrierCloseEvents)); + return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierCloseEvents) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &barrierCloseEvents, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BarrierCloseEvents namespace BarrierCommandOpenEvents { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierCommandOpenEvents) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) barrierCommandOpenEvents, - sizeof(*barrierCommandOpenEvents)); + return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierCommandOpenEvents) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &barrierCommandOpenEvents, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BarrierCommandOpenEvents namespace BarrierCommandCloseEvents { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierCommandCloseEvents) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) barrierCommandCloseEvents, - sizeof(*barrierCommandCloseEvents)); + return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierCommandCloseEvents) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &barrierCommandCloseEvents, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BarrierCommandCloseEvents namespace BarrierOpenPeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierOpenPeriod) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) barrierOpenPeriod, - sizeof(*barrierOpenPeriod)); + return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierOpenPeriod) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &barrierOpenPeriod, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BarrierOpenPeriod namespace BarrierClosePeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierClosePeriod) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) barrierClosePeriod, - sizeof(*barrierClosePeriod)); + return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierClosePeriod) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &barrierClosePeriod, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BarrierClosePeriod namespace BarrierPosition { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * barrierPosition) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) barrierPosition, - sizeof(*barrierPosition)); + return emberAfReadServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t barrierPosition) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &barrierPosition, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BarrierControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace BarrierPosition @@ -5132,14 +5667,13 @@ namespace Attributes { namespace MaxPressure { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxPressure) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) maxPressure, - sizeof(*maxPressure)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxPressure) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &maxPressure, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5147,14 +5681,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxPressure) namespace MaxSpeed { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxSpeed) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) maxSpeed, - sizeof(*maxSpeed)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxSpeed) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &maxSpeed, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5162,14 +5695,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxSpeed) namespace MaxFlow { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxFlow) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) maxFlow, - sizeof(*maxFlow)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxFlow) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &maxFlow, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5177,14 +5709,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxFlow) namespace MinConstPressure { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minConstPressure) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) minConstPressure, - sizeof(*minConstPressure)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minConstPressure) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &minConstPressure, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5192,14 +5723,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t minConstPressure) namespace MaxConstPressure { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxConstPressure) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) maxConstPressure, - sizeof(*maxConstPressure)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxConstPressure) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &maxConstPressure, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5207,14 +5737,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxConstPressure) namespace MinCompPressure { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minCompPressure) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) minCompPressure, - sizeof(*minCompPressure)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minCompPressure) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &minCompPressure, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5222,14 +5751,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t minCompPressure) namespace MaxCompPressure { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxCompPressure) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) maxCompPressure, - sizeof(*maxCompPressure)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxCompPressure) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &maxCompPressure, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5237,14 +5765,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxCompPressure) namespace MinConstSpeed { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * minConstSpeed) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) minConstSpeed, - sizeof(*minConstSpeed)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minConstSpeed) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &minConstSpeed, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5252,14 +5779,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minConstSpeed) namespace MaxConstSpeed { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxConstSpeed) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) maxConstSpeed, - sizeof(*maxConstSpeed)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxConstSpeed) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &maxConstSpeed, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5267,14 +5793,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxConstSpeed) namespace MinConstFlow { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * minConstFlow) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) minConstFlow, - sizeof(*minConstFlow)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minConstFlow) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &minConstFlow, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5282,14 +5807,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minConstFlow) namespace MaxConstFlow { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxConstFlow) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) maxConstFlow, - sizeof(*maxConstFlow)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxConstFlow) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &maxConstFlow, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5297,14 +5821,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxConstFlow) namespace MinConstTemp { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minConstTemp) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) minConstTemp, - sizeof(*minConstTemp)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minConstTemp) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &minConstTemp, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5312,14 +5835,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t minConstTemp) namespace MaxConstTemp { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxConstTemp) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) maxConstTemp, - sizeof(*maxConstTemp)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxConstTemp) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &maxConstTemp, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5327,14 +5849,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxConstTemp) namespace PumpStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * pumpStatus) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) pumpStatus, - sizeof(*pumpStatus)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t pumpStatus) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &pumpStatus, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5342,14 +5863,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t pumpStatus) namespace EffectiveOperationMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * effectiveOperationMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) effectiveOperationMode, - sizeof(*effectiveOperationMode)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t effectiveOperationMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &effectiveOperationMode, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -5357,14 +5877,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t effectiveOperationMode) namespace EffectiveControlMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * effectiveControlMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) effectiveControlMode, - sizeof(*effectiveControlMode)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t effectiveControlMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &effectiveControlMode, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -5372,14 +5891,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t effectiveControlMode) namespace Capacity { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * capacity) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) capacity, - sizeof(*capacity)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t capacity) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &capacity, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -5387,13 +5905,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t capacity) namespace Speed { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * speed) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) speed, sizeof(*speed)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t speed) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &speed, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -5401,14 +5919,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t speed) namespace LifetimeEnergyConsumed { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * lifetimeEnergyConsumed) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) lifetimeEnergyConsumed, - sizeof(*lifetimeEnergyConsumed)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t lifetimeEnergyConsumed) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &lifetimeEnergyConsumed, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -5416,14 +5933,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t lifetimeEnergyConsumed) namespace OperationMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * operationMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) operationMode, - sizeof(*operationMode)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t operationMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &operationMode, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -5431,14 +5947,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t operationMode) namespace ControlMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * controlMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) controlMode, - sizeof(*controlMode)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t controlMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &controlMode, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -5446,14 +5961,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t controlMode) namespace AlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * alarmMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) alarmMask, - sizeof(*alarmMask)); + return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t alarmMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &alarmMask, + return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -5467,628 +5981,559 @@ namespace Attributes { namespace LocalTemperature { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * localTemperature) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) localTemperature, - sizeof(*localTemperature)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t localTemperature) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &localTemperature, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace LocalTemperature namespace OutdoorTemperature { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * outdoorTemperature) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) outdoorTemperature, - sizeof(*outdoorTemperature)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t outdoorTemperature) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &outdoorTemperature, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace OutdoorTemperature namespace Occupancy { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * occupancy) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) occupancy, sizeof(*occupancy)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t occupancy) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &occupancy, ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace Occupancy namespace AbsMinHeatSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * absMinHeatSetpointLimit) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) absMinHeatSetpointLimit, - sizeof(*absMinHeatSetpointLimit)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t absMinHeatSetpointLimit) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &absMinHeatSetpointLimit, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AbsMinHeatSetpointLimit namespace AbsMaxHeatSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * absMaxHeatSetpointLimit) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) absMaxHeatSetpointLimit, - sizeof(*absMaxHeatSetpointLimit)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t absMaxHeatSetpointLimit) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &absMaxHeatSetpointLimit, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AbsMaxHeatSetpointLimit namespace AbsMinCoolSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * absMinCoolSetpointLimit) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) absMinCoolSetpointLimit, - sizeof(*absMinCoolSetpointLimit)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t absMinCoolSetpointLimit) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &absMinCoolSetpointLimit, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AbsMinCoolSetpointLimit namespace AbsMaxCoolSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * absMaxCoolSetpointLimit) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) absMaxCoolSetpointLimit, - sizeof(*absMaxCoolSetpointLimit)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t absMaxCoolSetpointLimit) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &absMaxCoolSetpointLimit, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AbsMaxCoolSetpointLimit namespace PiCoolingDemand { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * piCoolingDemand) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) piCoolingDemand, - sizeof(*piCoolingDemand)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t piCoolingDemand) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &piCoolingDemand, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace PiCoolingDemand namespace PiHeatingDemand { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * piHeatingDemand) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) piHeatingDemand, - sizeof(*piHeatingDemand)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t piHeatingDemand) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &piHeatingDemand, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace PiHeatingDemand namespace HvacSystemTypeConfiguration { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * hvacSystemTypeConfiguration) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) hvacSystemTypeConfiguration, - sizeof(*hvacSystemTypeConfiguration)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t hvacSystemTypeConfiguration) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &hvacSystemTypeConfiguration, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace HvacSystemTypeConfiguration namespace LocalTemperatureCalibration { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * localTemperatureCalibration) +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) localTemperatureCalibration, - sizeof(*localTemperatureCalibration)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int8_t localTemperatureCalibration) +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &localTemperatureCalibration, - ZCL_INT8S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace LocalTemperatureCalibration namespace OccupiedCoolingSetpoint { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * occupiedCoolingSetpoint) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) occupiedCoolingSetpoint, - sizeof(*occupiedCoolingSetpoint)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t occupiedCoolingSetpoint) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &occupiedCoolingSetpoint, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace OccupiedCoolingSetpoint namespace OccupiedHeatingSetpoint { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * occupiedHeatingSetpoint) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) occupiedHeatingSetpoint, - sizeof(*occupiedHeatingSetpoint)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t occupiedHeatingSetpoint) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &occupiedHeatingSetpoint, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace OccupiedHeatingSetpoint namespace UnoccupiedCoolingSetpoint { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * unoccupiedCoolingSetpoint) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) unoccupiedCoolingSetpoint, - sizeof(*unoccupiedCoolingSetpoint)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t unoccupiedCoolingSetpoint) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &unoccupiedCoolingSetpoint, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace UnoccupiedCoolingSetpoint namespace UnoccupiedHeatingSetpoint { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * unoccupiedHeatingSetpoint) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) unoccupiedHeatingSetpoint, - sizeof(*unoccupiedHeatingSetpoint)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t unoccupiedHeatingSetpoint) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &unoccupiedHeatingSetpoint, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace UnoccupiedHeatingSetpoint namespace MinHeatSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minHeatSetpointLimit) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) minHeatSetpointLimit, - sizeof(*minHeatSetpointLimit)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minHeatSetpointLimit) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &minHeatSetpointLimit, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MinHeatSetpointLimit namespace MaxHeatSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxHeatSetpointLimit) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) maxHeatSetpointLimit, - sizeof(*maxHeatSetpointLimit)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxHeatSetpointLimit) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &maxHeatSetpointLimit, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MaxHeatSetpointLimit namespace MinCoolSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minCoolSetpointLimit) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) minCoolSetpointLimit, - sizeof(*minCoolSetpointLimit)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minCoolSetpointLimit) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &minCoolSetpointLimit, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MinCoolSetpointLimit namespace MaxCoolSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxCoolSetpointLimit) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) maxCoolSetpointLimit, - sizeof(*maxCoolSetpointLimit)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxCoolSetpointLimit) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &maxCoolSetpointLimit, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MaxCoolSetpointLimit namespace MinSetpointDeadBand { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * minSetpointDeadBand) +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) minSetpointDeadBand, - sizeof(*minSetpointDeadBand)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int8_t minSetpointDeadBand) +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &minSetpointDeadBand, - ZCL_INT8S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace MinSetpointDeadBand namespace RemoteSensing { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * remoteSensing) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) remoteSensing, sizeof(*remoteSensing)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t remoteSensing) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &remoteSensing, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace RemoteSensing namespace ControlSequenceOfOperation { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * controlSequenceOfOperation) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) controlSequenceOfOperation, - sizeof(*controlSequenceOfOperation)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t controlSequenceOfOperation) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &controlSequenceOfOperation, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ControlSequenceOfOperation namespace SystemMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * systemMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) systemMode, sizeof(*systemMode)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t systemMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &systemMode, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace SystemMode namespace AlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * alarmMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) alarmMask, sizeof(*alarmMask)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t alarmMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &alarmMask, ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace AlarmMask namespace ThermostatRunningMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * thermostatRunningMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) thermostatRunningMode, - sizeof(*thermostatRunningMode)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t thermostatRunningMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &thermostatRunningMode, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ThermostatRunningMode namespace StartOfWeek { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * startOfWeek) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) startOfWeek, sizeof(*startOfWeek)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t startOfWeek) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &startOfWeek, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace StartOfWeek namespace NumberOfWeeklyTransitions { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numberOfWeeklyTransitions) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) numberOfWeeklyTransitions, - sizeof(*numberOfWeeklyTransitions)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numberOfWeeklyTransitions) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &numberOfWeeklyTransitions, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumberOfWeeklyTransitions namespace NumberOfDailyTransitions { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numberOfDailyTransitions) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) numberOfDailyTransitions, - sizeof(*numberOfDailyTransitions)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numberOfDailyTransitions) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &numberOfDailyTransitions, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumberOfDailyTransitions namespace TemperatureSetpointHold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * temperatureSetpointHold) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) temperatureSetpointHold, - sizeof(*temperatureSetpointHold)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t temperatureSetpointHold) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &temperatureSetpointHold, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace TemperatureSetpointHold namespace TemperatureSetpointHoldDuration { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * temperatureSetpointHoldDuration) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) temperatureSetpointHoldDuration, - sizeof(*temperatureSetpointHoldDuration)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t temperatureSetpointHoldDuration) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &temperatureSetpointHoldDuration, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace TemperatureSetpointHoldDuration namespace ThermostatProgrammingOperationMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * thermostatProgrammingOperationMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) thermostatProgrammingOperationMode, - sizeof(*thermostatProgrammingOperationMode)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t thermostatProgrammingOperationMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &thermostatProgrammingOperationMode, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace ThermostatProgrammingOperationMode namespace HvacRelayState { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * hvacRelayState) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) hvacRelayState, sizeof(*hvacRelayState)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t hvacRelayState) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &hvacRelayState, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace HvacRelayState namespace SetpointChangeSource { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * setpointChangeSource) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) setpointChangeSource, - sizeof(*setpointChangeSource)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t setpointChangeSource) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &setpointChangeSource, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace SetpointChangeSource namespace SetpointChangeAmount { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * setpointChangeAmount) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) setpointChangeAmount, - sizeof(*setpointChangeAmount)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t setpointChangeAmount) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &setpointChangeAmount, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace SetpointChangeAmount namespace SetpointChangeSourceTimestamp { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * setpointChangeSourceTimestamp) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) setpointChangeSourceTimestamp, - sizeof(*setpointChangeSourceTimestamp)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t setpointChangeSourceTimestamp) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &setpointChangeSourceTimestamp, - ZCL_EPOCH_S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } } // namespace SetpointChangeSourceTimestamp namespace AcType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * acType) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) acType, sizeof(*acType)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t acType) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &acType, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace AcType namespace AcCapacity { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acCapacity) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) acCapacity, sizeof(*acCapacity)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acCapacity) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &acCapacity, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AcCapacity namespace AcRefrigerantType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * acRefrigerantType) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) acRefrigerantType, - sizeof(*acRefrigerantType)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t acRefrigerantType) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &acRefrigerantType, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace AcRefrigerantType namespace AcCompressor { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * acCompressor) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) acCompressor, sizeof(*acCompressor)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t acCompressor) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &acCompressor, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace AcCompressor namespace AcErrorCode { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * acErrorCode) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) acErrorCode, sizeof(*acErrorCode)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t acErrorCode) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &acErrorCode, - ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace AcErrorCode namespace AcLouverPosition { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * acLouverPosition) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) acLouverPosition, - sizeof(*acLouverPosition)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t acLouverPosition) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &acLouverPosition, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace AcLouverPosition namespace AcCoilTemperature { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * acCoilTemperature) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) acCoilTemperature, - sizeof(*acCoilTemperature)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t acCoilTemperature) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &acCoilTemperature, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace AcCoilTemperature namespace AcCapacityFormat { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * acCapacityFormat) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) acCapacityFormat, - sizeof(*acCapacityFormat)); + return emberAfReadServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t acCapacityFormat) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &acCapacityFormat, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::Thermostat::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace AcCapacityFormat @@ -6101,28 +6546,26 @@ namespace Attributes { namespace FanMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * fanMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) fanMode, sizeof(*fanMode)); + return emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t fanMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) &fanMode, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace FanMode namespace FanModeSequence { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * fanModeSequence) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) fanModeSequence, - sizeof(*fanModeSequence)); + return emberAfReadServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t fanModeSequence) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) &fanModeSequence, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::FanControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace FanModeSequence @@ -6135,14 +6578,13 @@ namespace Attributes { namespace RelativeHumidity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * relativeHumidity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) relativeHumidity, - sizeof(*relativeHumidity)); + return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t relativeHumidity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &relativeHumidity, + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6150,14 +6592,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t relativeHumidity) namespace DehumidificationCooling { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * dehumidificationCooling) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) dehumidificationCooling, - sizeof(*dehumidificationCooling)); + return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dehumidificationCooling) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &dehumidificationCooling, + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6165,14 +6606,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dehumidificationCooling) namespace RhDehumidificationSetpoint { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * rhDehumidificationSetpoint) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) rhDehumidificationSetpoint, - sizeof(*rhDehumidificationSetpoint)); + return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t rhDehumidificationSetpoint) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &rhDehumidificationSetpoint, + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6180,14 +6620,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t rhDehumidificationSetpoint) namespace RelativeHumidityMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * relativeHumidityMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) relativeHumidityMode, - sizeof(*relativeHumidityMode)); + return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t relativeHumidityMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &relativeHumidityMode, + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6195,14 +6634,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t relativeHumidityMode) namespace DehumidificationLockout { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * dehumidificationLockout) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) dehumidificationLockout, - sizeof(*dehumidificationLockout)); + return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dehumidificationLockout) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &dehumidificationLockout, + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6210,14 +6648,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dehumidificationLockout) namespace DehumidificationHysteresis { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * dehumidificationHysteresis) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) dehumidificationHysteresis, - sizeof(*dehumidificationHysteresis)); + return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dehumidificationHysteresis) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &dehumidificationHysteresis, + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6225,14 +6662,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dehumidificationHysteresis) namespace DehumidificationMaxCool { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * dehumidificationMaxCool) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) dehumidificationMaxCool, - sizeof(*dehumidificationMaxCool)); + return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dehumidificationMaxCool) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &dehumidificationMaxCool, + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -6240,14 +6676,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dehumidificationMaxCool) namespace RelativeHumidityDisplay { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * relativeHumidityDisplay) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) relativeHumidityDisplay, - sizeof(*relativeHumidityDisplay)); + return emberAfReadServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t relativeHumidityDisplay) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &relativeHumidityDisplay, + return emberAfWriteServerAttribute(endpoint, Clusters::DehumidificationControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6261,29 +6696,29 @@ namespace Attributes { namespace TemperatureDisplayMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * temperatureDisplayMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, - (uint8_t *) temperatureDisplayMode, sizeof(*temperatureDisplayMode)); + return emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t temperatureDisplayMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, - (uint8_t *) &temperatureDisplayMode, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) &value, + ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace TemperatureDisplayMode namespace KeypadLockout { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * keypadLockout) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) keypadLockout, - sizeof(*keypadLockout)); + return emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t keypadLockout) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) &keypadLockout, + return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -6291,15 +6726,15 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t keypadLockout) namespace ScheduleProgrammingVisibility { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * scheduleProgrammingVisibility) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, - (uint8_t *) scheduleProgrammingVisibility, sizeof(*scheduleProgrammingVisibility)); + return emberAfReadServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t scheduleProgrammingVisibility) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, - (uint8_t *) &scheduleProgrammingVisibility, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ThermostatUserInterfaceConfiguration::Id, Id, (uint8_t *) &value, + ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ScheduleProgrammingVisibility @@ -6312,723 +6747,686 @@ namespace Attributes { namespace CurrentHue { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentHue) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) currentHue, sizeof(*currentHue)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentHue) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) ¤tHue, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentHue namespace CurrentSaturation { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentSaturation) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) currentSaturation, - sizeof(*currentSaturation)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentSaturation) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) ¤tSaturation, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentSaturation namespace RemainingTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * remainingTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) remainingTime, sizeof(*remainingTime)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t remainingTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &remainingTime, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RemainingTime namespace CurrentX { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentX) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) currentX, sizeof(*currentX)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentX) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) ¤tX, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentX namespace CurrentY { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentY) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) currentY, sizeof(*currentY)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentY) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) ¤tY, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CurrentY namespace DriftCompensation { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * driftCompensation) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) driftCompensation, - sizeof(*driftCompensation)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t driftCompensation) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &driftCompensation, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace DriftCompensation +namespace CompensationText { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[254 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 254); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 254, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[254 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace CompensationText + namespace ColorTemperature { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorTemperature) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorTemperature, - sizeof(*colorTemperature)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorTemperature) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorTemperature, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorTemperature namespace ColorMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorMode, sizeof(*colorMode)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorMode, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ColorMode namespace ColorControlOptions { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorControlOptions) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorControlOptions, - sizeof(*colorControlOptions)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorControlOptions) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorControlOptions, - ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace ColorControlOptions namespace NumberOfPrimaries { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numberOfPrimaries) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) numberOfPrimaries, - sizeof(*numberOfPrimaries)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numberOfPrimaries) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &numberOfPrimaries, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumberOfPrimaries namespace Primary1X { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary1X) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary1X, sizeof(*primary1X)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary1X) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary1X, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary1X namespace Primary1Y { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary1Y) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary1Y, sizeof(*primary1Y)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary1Y) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary1Y, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary1Y namespace Primary1Intensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * primary1Intensity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary1Intensity, - sizeof(*primary1Intensity)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t primary1Intensity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary1Intensity, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Primary1Intensity namespace Primary2X { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary2X) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary2X, sizeof(*primary2X)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary2X) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary2X, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary2X namespace Primary2Y { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary2Y) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary2Y, sizeof(*primary2Y)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary2Y) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary2Y, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary2Y namespace Primary2Intensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * primary2Intensity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary2Intensity, - sizeof(*primary2Intensity)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t primary2Intensity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary2Intensity, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Primary2Intensity namespace Primary3X { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary3X) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary3X, sizeof(*primary3X)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary3X) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary3X, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary3X namespace Primary3Y { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary3Y) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary3Y, sizeof(*primary3Y)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary3Y) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary3Y, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary3Y namespace Primary3Intensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * primary3Intensity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary3Intensity, - sizeof(*primary3Intensity)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t primary3Intensity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary3Intensity, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Primary3Intensity namespace Primary4X { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary4X) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary4X, sizeof(*primary4X)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary4X) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary4X, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary4X namespace Primary4Y { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary4Y) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary4Y, sizeof(*primary4Y)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary4Y) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary4Y, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary4Y namespace Primary4Intensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * primary4Intensity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary4Intensity, - sizeof(*primary4Intensity)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t primary4Intensity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary4Intensity, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Primary4Intensity namespace Primary5X { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary5X) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary5X, sizeof(*primary5X)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary5X) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary5X, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary5X namespace Primary5Y { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary5Y) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary5Y, sizeof(*primary5Y)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary5Y) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary5Y, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary5Y namespace Primary5Intensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * primary5Intensity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary5Intensity, - sizeof(*primary5Intensity)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t primary5Intensity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary5Intensity, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Primary5Intensity namespace Primary6X { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary6X) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary6X, sizeof(*primary6X)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary6X) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary6X, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary6X namespace Primary6Y { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary6Y) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary6Y, sizeof(*primary6Y)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary6Y) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary6Y, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Primary6Y namespace Primary6Intensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * primary6Intensity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) primary6Intensity, - sizeof(*primary6Intensity)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t primary6Intensity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &primary6Intensity, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Primary6Intensity namespace WhitePointX { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * whitePointX) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) whitePointX, sizeof(*whitePointX)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t whitePointX) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &whitePointX, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace WhitePointX namespace WhitePointY { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * whitePointY) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) whitePointY, sizeof(*whitePointY)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t whitePointY) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &whitePointY, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace WhitePointY namespace ColorPointRX { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorPointRX) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorPointRX, sizeof(*colorPointRX)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorPointRX) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorPointRX, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorPointRX namespace ColorPointRY { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorPointRY) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorPointRY, sizeof(*colorPointRY)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorPointRY) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorPointRY, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorPointRY namespace ColorPointRIntensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorPointRIntensity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorPointRIntensity, - sizeof(*colorPointRIntensity)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorPointRIntensity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorPointRIntensity, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace ColorPointRIntensity namespace ColorPointGX { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorPointGX) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorPointGX, sizeof(*colorPointGX)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorPointGX) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorPointGX, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorPointGX namespace ColorPointGY { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorPointGY) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorPointGY, sizeof(*colorPointGY)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorPointGY) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorPointGY, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorPointGY namespace ColorPointGIntensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorPointGIntensity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorPointGIntensity, - sizeof(*colorPointGIntensity)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorPointGIntensity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorPointGIntensity, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace ColorPointGIntensity namespace ColorPointBX { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorPointBX) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorPointBX, sizeof(*colorPointBX)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorPointBX) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorPointBX, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorPointBX namespace ColorPointBY { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorPointBY) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorPointBY, sizeof(*colorPointBY)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorPointBY) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorPointBY, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorPointBY namespace ColorPointBIntensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorPointBIntensity) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorPointBIntensity, - sizeof(*colorPointBIntensity)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorPointBIntensity) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorPointBIntensity, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace ColorPointBIntensity namespace EnhancedCurrentHue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * enhancedCurrentHue) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) enhancedCurrentHue, - sizeof(*enhancedCurrentHue)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t enhancedCurrentHue) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &enhancedCurrentHue, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace EnhancedCurrentHue namespace EnhancedColorMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * enhancedColorMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) enhancedColorMode, - sizeof(*enhancedColorMode)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t enhancedColorMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &enhancedColorMode, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace EnhancedColorMode namespace ColorLoopActive { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorLoopActive) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorLoopActive, - sizeof(*colorLoopActive)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorLoopActive) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorLoopActive, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace ColorLoopActive namespace ColorLoopDirection { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorLoopDirection) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorLoopDirection, - sizeof(*colorLoopDirection)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorLoopDirection) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorLoopDirection, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace ColorLoopDirection namespace ColorLoopTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorLoopTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorLoopTime, sizeof(*colorLoopTime)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorLoopTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorLoopTime, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorLoopTime namespace ColorLoopStartEnhancedHue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorLoopStartEnhancedHue) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorLoopStartEnhancedHue, - sizeof(*colorLoopStartEnhancedHue)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorLoopStartEnhancedHue) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorLoopStartEnhancedHue, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorLoopStartEnhancedHue namespace ColorLoopStoredEnhancedHue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorLoopStoredEnhancedHue) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorLoopStoredEnhancedHue, - sizeof(*colorLoopStoredEnhancedHue)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorLoopStoredEnhancedHue) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorLoopStoredEnhancedHue, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorLoopStoredEnhancedHue namespace ColorCapabilities { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorCapabilities) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorCapabilities, - sizeof(*colorCapabilities)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorCapabilities) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorCapabilities, - ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace ColorCapabilities namespace ColorTempPhysicalMin { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorTempPhysicalMin) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorTempPhysicalMin, - sizeof(*colorTempPhysicalMin)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorTempPhysicalMin) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorTempPhysicalMin, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorTempPhysicalMin namespace ColorTempPhysicalMax { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorTempPhysicalMax) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) colorTempPhysicalMax, - sizeof(*colorTempPhysicalMax)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorTempPhysicalMax) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &colorTempPhysicalMax, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ColorTempPhysicalMax namespace CoupleColorTempToLevelMinMireds { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * coupleColorTempToLevelMinMireds) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) coupleColorTempToLevelMinMireds, - sizeof(*coupleColorTempToLevelMinMireds)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t coupleColorTempToLevelMinMireds) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &coupleColorTempToLevelMinMireds, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CoupleColorTempToLevelMinMireds namespace StartUpColorTemperatureMireds { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * startUpColorTemperatureMireds) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) startUpColorTemperatureMireds, - sizeof(*startUpColorTemperatureMireds)); + return emberAfReadServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t startUpColorTemperatureMireds) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &startUpColorTemperatureMireds, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ColorControl::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace StartUpColorTemperatureMireds @@ -7041,14 +7439,13 @@ namespace Attributes { namespace PhysicalMinLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * physicalMinLevel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) physicalMinLevel, - sizeof(*physicalMinLevel)); + return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t physicalMinLevel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &physicalMinLevel, + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7056,14 +7453,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t physicalMinLevel) namespace PhysicalMaxLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * physicalMaxLevel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) physicalMaxLevel, - sizeof(*physicalMaxLevel)); + return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t physicalMaxLevel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &physicalMaxLevel, + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7071,14 +7467,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t physicalMaxLevel) namespace BallastStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * ballastStatus) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) ballastStatus, - sizeof(*ballastStatus)); + return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t ballastStatus) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &ballastStatus, + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -7086,13 +7481,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t ballastStatus) namespace MinLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * minLevel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) minLevel, sizeof(*minLevel)); + return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t minLevel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &minLevel, + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7100,13 +7495,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t minLevel) namespace MaxLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * maxLevel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) maxLevel, sizeof(*maxLevel)); + return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t maxLevel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &maxLevel, + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7114,14 +7509,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t maxLevel) namespace PowerOnLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * powerOnLevel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) powerOnLevel, - sizeof(*powerOnLevel)); + return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t powerOnLevel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &powerOnLevel, + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7129,14 +7523,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t powerOnLevel) namespace PowerOnFadeTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * powerOnFadeTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) powerOnFadeTime, - sizeof(*powerOnFadeTime)); + return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t powerOnFadeTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &powerOnFadeTime, + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7144,14 +7537,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t powerOnFadeTime) namespace IntrinsicBallastFactor { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * intrinsicBallastFactor) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) intrinsicBallastFactor, - sizeof(*intrinsicBallastFactor)); + return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t intrinsicBallastFactor) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &intrinsicBallastFactor, + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7159,14 +7551,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t intrinsicBallastFactor) namespace BallastFactorAdjustment { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * ballastFactorAdjustment) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) ballastFactorAdjustment, - sizeof(*ballastFactorAdjustment)); + return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t ballastFactorAdjustment) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &ballastFactorAdjustment, + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -7174,29 +7565,75 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t ballastFactorAdjustment) namespace LampQuality { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * lampQuality) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) lampQuality, - sizeof(*lampQuality)); + return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lampQuality) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &lampQuality, + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace LampQuality +namespace LampType { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace LampType + +namespace LampManufacturer { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace LampManufacturer + namespace LampAlarmMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * lampAlarmMode) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) lampAlarmMode, - sizeof(*lampAlarmMode)); + return emberAfReadServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lampAlarmMode) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &lampAlarmMode, + return emberAfWriteServerAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -7210,14 +7647,13 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7225,14 +7661,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7240,14 +7675,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7255,14 +7689,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7270,14 +7703,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t tolerance) namespace LightSensorType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * lightSensorType) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) lightSensorType, - sizeof(*lightSensorType)); + return emberAfReadServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lightSensorType) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &lightSensorType, + return emberAfWriteServerAttribute(endpoint, Clusters::IlluminanceMeasurement::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } @@ -7291,14 +7723,13 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7306,14 +7737,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7321,14 +7751,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7336,14 +7765,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::TemperatureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7357,14 +7785,13 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7372,14 +7799,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7387,14 +7813,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7402,13 +7827,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) tolerance, sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7416,14 +7841,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t tolerance) namespace ScaledValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * scaledValue) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) scaledValue, - sizeof(*scaledValue)); + return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t scaledValue) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &scaledValue, + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7431,14 +7855,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t scaledValue) namespace MinScaledValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minScaledValue) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) minScaledValue, - sizeof(*minScaledValue)); + return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minScaledValue) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &minScaledValue, + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7446,14 +7869,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t minScaledValue) namespace MaxScaledValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxScaledValue) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) maxScaledValue, - sizeof(*maxScaledValue)); + return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxScaledValue) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &maxScaledValue, + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -7461,14 +7883,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxScaledValue) namespace ScaledTolerance { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * scaledTolerance) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) scaledTolerance, - sizeof(*scaledTolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t scaledTolerance) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &scaledTolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7476,13 +7897,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t scaledTolerance) namespace Scale { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * scale) +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) scale, sizeof(*scale)); + return emberAfReadServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int8_t scale) +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &scale, + return emberAfWriteServerAttribute(endpoint, Clusters::PressureMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -7496,59 +7917,52 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &measuredValue, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, - ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) tolerance, sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &tolerance, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::FlowMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Tolerance @@ -7561,14 +7975,13 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7576,14 +7989,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7591,14 +8003,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7606,14 +8017,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::RelativeHumidityMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -7627,13 +8037,13 @@ namespace Attributes { namespace Occupancy { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * occupancy) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) occupancy, sizeof(*occupancy)); + return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t occupancy) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &occupancy, + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -7641,29 +8051,26 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t occupancy) namespace OccupancySensorType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * occupancySensorType) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) occupancySensorType, - sizeof(*occupancySensorType)); + return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t occupancySensorType) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &occupancySensorType, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace OccupancySensorType namespace OccupancySensorTypeBitmap { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * occupancySensorTypeBitmap) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) occupancySensorTypeBitmap, - sizeof(*occupancySensorTypeBitmap)); + return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t occupancySensorTypeBitmap) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &occupancySensorTypeBitmap, + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -7671,139 +8078,117 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t occupancySensorTypeBitmap) namespace PirOccupiedToUnoccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * pirOccupiedToUnoccupiedDelay) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) pirOccupiedToUnoccupiedDelay, - sizeof(*pirOccupiedToUnoccupiedDelay)); + return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t pirOccupiedToUnoccupiedDelay) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &pirOccupiedToUnoccupiedDelay, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PirOccupiedToUnoccupiedDelay namespace PirUnoccupiedToOccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * pirUnoccupiedToOccupiedDelay) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) pirUnoccupiedToOccupiedDelay, - sizeof(*pirUnoccupiedToOccupiedDelay)); + return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t pirUnoccupiedToOccupiedDelay) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &pirUnoccupiedToOccupiedDelay, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PirUnoccupiedToOccupiedDelay namespace PirUnoccupiedToOccupiedThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * pirUnoccupiedToOccupiedThreshold) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) pirUnoccupiedToOccupiedThreshold, - sizeof(*pirUnoccupiedToOccupiedThreshold)); + return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t pirUnoccupiedToOccupiedThreshold) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &pirUnoccupiedToOccupiedThreshold, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace PirUnoccupiedToOccupiedThreshold namespace UltrasonicOccupiedToUnoccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * ultrasonicOccupiedToUnoccupiedDelay) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) ultrasonicOccupiedToUnoccupiedDelay, - sizeof(*ultrasonicOccupiedToUnoccupiedDelay)); + return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t ultrasonicOccupiedToUnoccupiedDelay) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, - (uint8_t *) &ultrasonicOccupiedToUnoccupiedDelay, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace UltrasonicOccupiedToUnoccupiedDelay namespace UltrasonicUnoccupiedToOccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * ultrasonicUnoccupiedToOccupiedDelay) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) ultrasonicUnoccupiedToOccupiedDelay, - sizeof(*ultrasonicUnoccupiedToOccupiedDelay)); + return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t ultrasonicUnoccupiedToOccupiedDelay) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, - (uint8_t *) &ultrasonicUnoccupiedToOccupiedDelay, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace UltrasonicUnoccupiedToOccupiedDelay namespace UltrasonicUnoccupiedToOccupiedThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * ultrasonicUnoccupiedToOccupiedThreshold) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, - (uint8_t *) ultrasonicUnoccupiedToOccupiedThreshold, - sizeof(*ultrasonicUnoccupiedToOccupiedThreshold)); + return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t ultrasonicUnoccupiedToOccupiedThreshold) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, - (uint8_t *) &ultrasonicUnoccupiedToOccupiedThreshold, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace UltrasonicUnoccupiedToOccupiedThreshold namespace PhysicalContactOccupiedToUnoccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * physicalContactOccupiedToUnoccupiedDelay) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, - (uint8_t *) physicalContactOccupiedToUnoccupiedDelay, - sizeof(*physicalContactOccupiedToUnoccupiedDelay)); + return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t physicalContactOccupiedToUnoccupiedDelay) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, - (uint8_t *) &physicalContactOccupiedToUnoccupiedDelay, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PhysicalContactOccupiedToUnoccupiedDelay namespace PhysicalContactUnoccupiedToOccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * physicalContactUnoccupiedToOccupiedDelay) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, - (uint8_t *) physicalContactUnoccupiedToOccupiedDelay, - sizeof(*physicalContactUnoccupiedToOccupiedDelay)); + return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t physicalContactUnoccupiedToOccupiedDelay) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, - (uint8_t *) &physicalContactUnoccupiedToOccupiedDelay, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace PhysicalContactUnoccupiedToOccupiedDelay namespace PhysicalContactUnoccupiedToOccupiedThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * physicalContactUnoccupiedToOccupiedThreshold) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, - (uint8_t *) physicalContactUnoccupiedToOccupiedThreshold, - sizeof(*physicalContactUnoccupiedToOccupiedThreshold)); + return emberAfReadServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t physicalContactUnoccupiedToOccupiedThreshold) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, - (uint8_t *) &physicalContactUnoccupiedToOccupiedThreshold, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::OccupancySensing::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace PhysicalContactUnoccupiedToOccupiedThreshold @@ -7816,59 +8201,59 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, - (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, - (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, - (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonMonoxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -7882,59 +8267,59 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::CarbonDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -7948,14 +8333,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -7963,14 +8348,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -7978,14 +8363,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -7993,14 +8378,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8014,59 +8399,59 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, - (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, - (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, - (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::EthyleneOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8080,14 +8465,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8095,14 +8480,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8110,14 +8495,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8125,14 +8510,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8146,59 +8531,59 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, - (uint8_t *) measuredValue, sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, - (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, - (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, - (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::HydrogenSulphideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8212,14 +8597,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8227,44 +8612,44 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::NitricOxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8278,59 +8663,59 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) measuredValue, sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::NitrogenDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8344,14 +8729,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8359,14 +8744,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8374,14 +8759,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8389,14 +8774,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::OxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8410,14 +8795,13 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8425,14 +8809,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8440,14 +8823,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8455,14 +8837,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::OzoneConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8476,59 +8857,59 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::SulfurDioxideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8542,59 +8923,59 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, - (uint8_t *) measuredValue, sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, - (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, - (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, - (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::DissolvedOxygenConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8608,14 +8989,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8623,14 +9004,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8638,14 +9019,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8653,14 +9034,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::BromateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8674,14 +9055,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8689,44 +9070,44 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::ChloraminesConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8740,14 +9121,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8755,14 +9136,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8770,14 +9151,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8785,14 +9166,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorineConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8806,60 +9187,60 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - (uint8_t *) measuredValue, sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - (uint8_t *) tolerance, sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { return emberAfWriteServerAttribute(endpoint, Clusters::FecalColiformAndEColiConcentrationMeasurement::Id, Id, - (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); + (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace Tolerance @@ -8872,14 +9253,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8887,14 +9268,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8902,14 +9283,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8917,14 +9298,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::FluorideConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -8938,59 +9319,59 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, - (uint8_t *) measuredValue, sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, - (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, - (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, - (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::HaloaceticAcidsConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9004,60 +9385,60 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, - (uint8_t *) measuredValue, sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, - (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, - (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, - (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, - (uint8_t *) tolerance, sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, - (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TotalTrihalomethanesConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace Tolerance @@ -9070,60 +9451,60 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - (uint8_t *) measuredValue, sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - (uint8_t *) tolerance, sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { return emberAfWriteServerAttribute(endpoint, Clusters::TotalColiformBacteriaConcentrationMeasurement::Id, Id, - (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); + (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace Tolerance @@ -9136,14 +9517,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9151,14 +9532,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9166,14 +9547,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9181,14 +9562,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::TurbidityConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9202,14 +9583,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9217,14 +9598,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9232,14 +9613,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9247,14 +9628,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::CopperConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9268,14 +9649,13 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9283,14 +9663,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9298,14 +9677,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9313,14 +9691,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::LeadConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9334,14 +9711,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9349,14 +9726,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9364,14 +9741,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9379,14 +9756,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::ManganeseConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9400,14 +9777,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9415,14 +9792,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9430,14 +9807,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9445,14 +9822,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::SulfateConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9466,60 +9843,60 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, - (uint8_t *) measuredValue, sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, - (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, - (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, - (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, - (uint8_t *) tolerance, sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, - (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::BromodichloromethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace Tolerance @@ -9532,14 +9909,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9547,14 +9924,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9562,14 +9939,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9577,14 +9954,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::BromoformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9598,60 +9975,60 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, - (uint8_t *) measuredValue, sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, - (uint8_t *) &measuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, - (uint8_t *) minMeasuredValue, sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, - (uint8_t *) maxMeasuredValue, sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, - (uint8_t *) tolerance, sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, - (uint8_t *) &tolerance, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ChlorodibromomethaneConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace Tolerance @@ -9664,14 +10041,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9679,44 +10056,44 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, - (uint8_t *) &minMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, - (uint8_t *) &maxMeasuredValue, ZCL_SINGLE_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &value, + ZCL_SINGLE_ATTRIBUTE_TYPE); } } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::ChloroformConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9730,14 +10107,14 @@ namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) measuredValue, - sizeof(*measuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &measuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9745,14 +10122,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue) namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) minMeasuredValue, - sizeof(*minMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &minMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9760,14 +10137,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue) namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) maxMeasuredValue, - sizeof(*maxMeasuredValue)); + return emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &maxMeasuredValue, + return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9775,14 +10152,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue) namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance) +EmberAfStatus Get(chip::EndpointId endpoint, float * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) tolerance, - sizeof(*tolerance)); + return emberAfReadServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) value, + sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance) +EmberAfStatus Set(chip::EndpointId endpoint, float value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &tolerance, + return emberAfWriteServerAttribute(endpoint, Clusters::SodiumConcentrationMeasurement::Id, Id, (uint8_t *) &value, ZCL_SINGLE_ATTRIBUTE_TYPE); } @@ -9796,95 +10173,91 @@ namespace Attributes { namespace ZoneState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * zoneState) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) zoneState, sizeof(*zoneState)); + return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t zoneState) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &zoneState, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ZoneState namespace ZoneType { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * zoneType) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) zoneType, sizeof(*zoneType)); + return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t zoneType) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &zoneType, ZCL_ENUM16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_ENUM16_ATTRIBUTE_TYPE); } } // namespace ZoneType namespace ZoneStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * zoneStatus) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) zoneStatus, sizeof(*zoneStatus)); + return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t zoneStatus) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &zoneStatus, ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace ZoneStatus namespace IasCieAddress { -EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * iasCieAddress) +EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) iasCieAddress, sizeof(*iasCieAddress)); + return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId iasCieAddress) +EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId value) { - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &iasCieAddress, ZCL_NODE_ID_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_NODE_ID_ATTRIBUTE_TYPE); } } // namespace IasCieAddress namespace ZoneId { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * zoneId) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) zoneId, sizeof(*zoneId)); + return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t zoneId) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &zoneId, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace ZoneId namespace NumberOfZoneSensitivityLevelsSupported { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numberOfZoneSensitivityLevelsSupported) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) numberOfZoneSensitivityLevelsSupported, - sizeof(*numberOfZoneSensitivityLevelsSupported)); + return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numberOfZoneSensitivityLevelsSupported) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &numberOfZoneSensitivityLevelsSupported, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace NumberOfZoneSensitivityLevelsSupported namespace CurrentZoneSensitivityLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentZoneSensitivityLevel) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) currentZoneSensitivityLevel, - sizeof(*currentZoneSensitivityLevel)); + return emberAfReadServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentZoneSensitivityLevel) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) ¤tZoneSensitivityLevel, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::IasZone::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentZoneSensitivityLevel @@ -9897,13 +10270,13 @@ namespace Attributes { namespace MaxDuration { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxDuration) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::IasWd::Id, Id, (uint8_t *) maxDuration, sizeof(*maxDuration)); + return emberAfReadServerAttribute(endpoint, Clusters::IasWd::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxDuration) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::IasWd::Id, Id, (uint8_t *) &maxDuration, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::IasWd::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace MaxDuration @@ -9914,12 +10287,81 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxDuration) namespace WakeOnLan { namespace Attributes { +namespace WakeOnLanMacAddress { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace WakeOnLanMacAddress + } // namespace Attributes } // namespace WakeOnLan namespace TvChannel { namespace Attributes { +namespace TvChannelLineup { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TvChannel::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::TvChannel::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace TvChannelLineup + +namespace CurrentTvChannel { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TvChannel::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::TvChannel::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace CurrentTvChannel + } // namespace Attributes } // namespace TvChannel @@ -9928,15 +10370,13 @@ namespace Attributes { namespace CurrentNavigatorTarget { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentNavigatorTarget) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, (uint8_t *) currentNavigatorTarget, - sizeof(*currentNavigatorTarget)); + return emberAfReadServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentNavigatorTarget) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, (uint8_t *) ¤tNavigatorTarget, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TargetNavigator::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentNavigatorTarget @@ -9949,112 +10389,104 @@ namespace Attributes { namespace PlaybackState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * playbackState) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) playbackState, sizeof(*playbackState)); + return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t playbackState) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &playbackState, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace PlaybackState namespace StartTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * startTime) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) startTime, sizeof(*startTime)); + return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t startTime) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &startTime, - ZCL_INT64U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace StartTime namespace Duration { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * duration) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) duration, sizeof(*duration)); + return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t duration) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &duration, ZCL_INT64U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace Duration namespace PositionUpdatedAt { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * positionUpdatedAt) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) positionUpdatedAt, - sizeof(*positionUpdatedAt)); + return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t positionUpdatedAt) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &positionUpdatedAt, - ZCL_INT64U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace PositionUpdatedAt namespace Position { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * position) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) position, sizeof(*position)); + return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t position) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &position, ZCL_INT64U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace Position namespace PlaybackSpeed { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * playbackSpeed) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) playbackSpeed, sizeof(*playbackSpeed)); + return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t playbackSpeed) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &playbackSpeed, - ZCL_INT64U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace PlaybackSpeed namespace SeekRangeEnd { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * seekRangeEnd) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) seekRangeEnd, sizeof(*seekRangeEnd)); + return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t seekRangeEnd) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &seekRangeEnd, - ZCL_INT64U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace SeekRangeEnd namespace SeekRangeStart { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * seekRangeStart) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) seekRangeStart, - sizeof(*seekRangeStart)); + return emberAfReadServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t seekRangeStart) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &seekRangeStart, - ZCL_INT64U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaPlayback::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace SeekRangeStart @@ -10067,15 +10499,13 @@ namespace Attributes { namespace CurrentMediaInput { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentMediaInput) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MediaInput::Id, Id, (uint8_t *) currentMediaInput, - sizeof(*currentMediaInput)); + return emberAfReadServerAttribute(endpoint, Clusters::MediaInput::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentMediaInput) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::MediaInput::Id, Id, (uint8_t *) ¤tMediaInput, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::MediaInput::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentMediaInput @@ -10094,15 +10524,13 @@ namespace Attributes { namespace CurrentAudioOutput { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentAudioOutput) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, (uint8_t *) currentAudioOutput, - sizeof(*currentAudioOutput)); + return emberAfReadServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentAudioOutput) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, (uint8_t *) ¤tAudioOutput, - ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::AudioOutput::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace CurrentAudioOutput @@ -10115,14 +10543,13 @@ namespace Attributes { namespace CatalogVendorId { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * catalogVendorId) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) catalogVendorId, - sizeof(*catalogVendorId)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t catalogVendorId) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) &catalogVendorId, + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -10130,14 +10557,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t catalogVendorId) namespace ApplicationId { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * applicationId) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) applicationId, - sizeof(*applicationId)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t applicationId) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) &applicationId, + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationLauncher::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -10149,60 +10575,123 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t applicationId) namespace ApplicationBasic { namespace Attributes { +namespace VendorName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace VendorName + namespace VendorId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * vendorId) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) vendorId, sizeof(*vendorId)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t vendorId) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &vendorId, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace VendorId +namespace ApplicationName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ApplicationName + namespace ProductId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * productId) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) productId, sizeof(*productId)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t productId) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &productId, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ProductId +namespace ApplicationId { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 32); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 32, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[32 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ApplicationId + namespace CatalogVendorId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * catalogVendorId) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) catalogVendorId, - sizeof(*catalogVendorId)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t catalogVendorId) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &catalogVendorId, - ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CatalogVendorId namespace ApplicationStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * applicationStatus) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) applicationStatus, - sizeof(*applicationStatus)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t applicationStatus) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &applicationStatus, - ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace ApplicationStatus @@ -10215,249 +10704,339 @@ namespace Attributes { namespace Boolean { -EmberAfStatus Get(chip::EndpointId endpoint, bool * boolean) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) boolean, sizeof(*boolean)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool boolean) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &boolean, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace Boolean namespace Bitmap8 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * bitmap8) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) bitmap8, sizeof(*bitmap8)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t bitmap8) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &bitmap8, ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } } // namespace Bitmap8 namespace Bitmap16 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * bitmap16) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) bitmap16, sizeof(*bitmap16)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t bitmap16) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &bitmap16, ZCL_BITMAP16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } } // namespace Bitmap16 namespace Bitmap32 { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * bitmap32) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) bitmap32, sizeof(*bitmap32)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t bitmap32) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &bitmap32, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace Bitmap32 namespace Bitmap64 { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * bitmap64) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) bitmap64, sizeof(*bitmap64)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t bitmap64) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &bitmap64, ZCL_BITMAP64_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BITMAP64_ATTRIBUTE_TYPE); } } // namespace Bitmap64 namespace Int8u { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * int8u) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) int8u, sizeof(*int8u)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t int8u) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &int8u, ZCL_INT8U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } } // namespace Int8u namespace Int16u { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * int16u) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) int16u, sizeof(*int16u)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t int16u) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &int16u, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace Int16u namespace Int32u { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * int32u) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) int32u, sizeof(*int32u)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t int32u) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &int32u, ZCL_INT32U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } } // namespace Int32u namespace Int64u { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * int64u) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) int64u, sizeof(*int64u)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t int64u) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &int64u, ZCL_INT64U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT64U_ATTRIBUTE_TYPE); } } // namespace Int64u namespace Int8s { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * int8s) +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) int8s, sizeof(*int8s)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int8_t int8s) +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &int8s, ZCL_INT8S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace Int8s namespace Int16s { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * int16s) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) int16s, sizeof(*int16s)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t int16s) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &int16s, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace Int16s namespace Int32s { -EmberAfStatus Get(chip::EndpointId endpoint, int32_t * int32s) +EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) int32s, sizeof(*int32s)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int32_t int32s) +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &int32s, ZCL_INT32S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); } } // namespace Int32s namespace Int64s { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * int64s) +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) int64s, sizeof(*int64s)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int64_t int64s) +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &int64s, ZCL_INT64S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_INT64S_ATTRIBUTE_TYPE); } } // namespace Int64s namespace Enum8 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * enum8) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) enum8, sizeof(*enum8)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t enum8) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &enum8, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_ENUM8_ATTRIBUTE_TYPE); } } // namespace Enum8 namespace Enum16 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * enum16) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) enum16, sizeof(*enum16)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t enum16) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &enum16, ZCL_ENUM16_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_ENUM16_ATTRIBUTE_TYPE); } } // namespace Enum16 +namespace OctetString { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[10 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 10); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[10 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace OctetString + +namespace LongOctetString { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 1000, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[1000 + 2]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[2], 1000); + value.reduce_size(emberAfLongStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 1000, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[1000 + 2]; + emberAfCopyInt16u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[2], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, ZCL_LONG_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace LongOctetString + +namespace CharString { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[10 + 1]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 10); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 10, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[10 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace CharString + +namespace LongCharString { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 1000, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[1000 + 2]; + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[2], 1000); + value.reduce_size(emberAfLongStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 1000, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[1000 + 2]; + emberAfCopyInt16u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[2], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace LongCharString + namespace EpochUs { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * epochUs) +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) epochUs, sizeof(*epochUs)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t epochUs) +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &epochUs, ZCL_EPOCH_US_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_EPOCH_US_ATTRIBUTE_TYPE); } } // namespace EpochUs namespace EpochS { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * epochS) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) epochS, sizeof(*epochS)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t epochS) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &epochS, ZCL_EPOCH_S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_EPOCH_S_ATTRIBUTE_TYPE); } } // namespace EpochS namespace VendorId { -EmberAfStatus Get(chip::EndpointId endpoint, chip::VendorId * vendorId) +EmberAfStatus Get(chip::EndpointId endpoint, chip::VendorId * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) vendorId, sizeof(*vendorId)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId vendorId) +EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &vendorId, - ZCL_VENDOR_ID_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_VENDOR_ID_ATTRIBUTE_TYPE); } } // namespace VendorId namespace Unsupported { -EmberAfStatus Get(chip::EndpointId endpoint, bool * unsupported) +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) { - return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) unsupported, sizeof(*unsupported)); + return emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, bool unsupported) +EmberAfStatus Set(chip::EndpointId endpoint, bool value) { - return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &unsupported, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, (uint8_t *) &value, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } } // namespace Unsupported @@ -10468,45 +11047,218 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool unsupported) namespace ApplianceIdentification { namespace Attributes { +namespace CompanyName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, + ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace CompanyName + namespace CompanyId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * companyId) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) companyId, - sizeof(*companyId)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t companyId) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &companyId, + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace CompanyId +namespace BrandName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, + ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace BrandName + namespace BrandId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * brandId) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) brandId, sizeof(*brandId)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t brandId) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &brandId, + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace BrandId +namespace Model { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, + ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace Model + +namespace PartNumber { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, + ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace PartNumber + +namespace ProductRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[6 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 6); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[6 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, + ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ProductRevision + +namespace SoftwareRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[6 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 6); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[6 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, + ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace SoftwareRevision + +namespace ProductTypeName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[2 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 2); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 2, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[2 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, zclString, + ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ProductTypeName + namespace ProductTypeId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * productTypeId) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) productTypeId, - sizeof(*productTypeId)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t productTypeId) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &productTypeId, + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10514,14 +11266,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t productTypeId) namespace CecedSpecificationVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * cecedSpecificationVersion) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) cecedSpecificationVersion, - sizeof(*cecedSpecificationVersion)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t cecedSpecificationVersion) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &cecedSpecificationVersion, + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceIdentification::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -10533,16 +11284,39 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t cecedSpecificationVersion) namespace MeterIdentification { namespace Attributes { +namespace CompanyName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace CompanyName + namespace MeterTypeId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * meterTypeId) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) meterTypeId, - sizeof(*meterTypeId)); + return emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t meterTypeId) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) &meterTypeId, + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10550,19 +11324,186 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t meterTypeId) namespace DataQualityId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dataQualityId) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) dataQualityId, - sizeof(*dataQualityId)); + return emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dataQualityId) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) &dataQualityId, + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace DataQualityId +namespace CustomerName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace CustomerName + +namespace Model { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace Model + +namespace PartNumber { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace PartNumber + +namespace ProductRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[6 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 6); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[6 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace ProductRevision + +namespace SoftwareRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +{ + VerifyOrReturnError(value.size() == 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[6 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 6); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) +{ + VerifyOrReturnError(value.size() <= 6, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[6 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); +} + +} // namespace SoftwareRevision + +namespace UtilityName { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace UtilityName + +namespace Pod { + +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +{ + VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + EmberAfStatus status = + emberAfReadServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, sizeof(zclString)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + memcpy(value.data(), &zclString[1], 16); + value.reduce_size(emberAfStringLength(zclString)); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) +{ + VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_INVALID_ARGUMENT); + uint8_t zclString[16 + 1]; + emberAfCopyInt8u(zclString, 0, static_cast(value.size())); + memcpy(&zclString[1], value.data(), value.size()); + return emberAfWriteServerAttribute(endpoint, Clusters::MeterIdentification::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); +} + +} // namespace Pod + } // namespace Attributes } // namespace MeterIdentification @@ -10571,13 +11512,13 @@ namespace Attributes { namespace LogMaxSize { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * logMaxSize) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) logMaxSize, sizeof(*logMaxSize)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t logMaxSize) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) &logMaxSize, + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -10585,14 +11526,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t logMaxSize) namespace LogQueueMaxSize { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * logQueueMaxSize) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) logQueueMaxSize, - sizeof(*logQueueMaxSize)); + return emberAfReadServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t logQueueMaxSize) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) &logQueueMaxSize, + return emberAfWriteServerAttribute(endpoint, Clusters::ApplianceStatistics::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -10606,14 +11546,13 @@ namespace Attributes { namespace MeasurementType { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * measurementType) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) measurementType, - sizeof(*measurementType)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t measurementType) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &measurementType, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_BITMAP32_ATTRIBUTE_TYPE); } @@ -10621,13 +11560,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t measurementType) namespace DcVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcVoltage, sizeof(*dcVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcVoltage, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10635,14 +11574,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcVoltage) namespace DcVoltageMin { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcVoltageMin) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcVoltageMin, - sizeof(*dcVoltageMin)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcVoltageMin) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcVoltageMin, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10650,14 +11588,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcVoltageMin) namespace DcVoltageMax { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcVoltageMax) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcVoltageMax, - sizeof(*dcVoltageMax)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcVoltageMax) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcVoltageMax, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10665,13 +11602,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcVoltageMax) namespace DcCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcCurrent, sizeof(*dcCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcCurrent, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10679,14 +11616,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcCurrent) namespace DcCurrentMin { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcCurrentMin) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcCurrentMin, - sizeof(*dcCurrentMin)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcCurrentMin) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcCurrentMin, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10694,14 +11630,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcCurrentMin) namespace DcCurrentMax { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcCurrentMax) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcCurrentMax, - sizeof(*dcCurrentMax)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcCurrentMax) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcCurrentMax, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10709,13 +11644,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcCurrentMax) namespace DcPower { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcPower) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcPower, sizeof(*dcPower)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcPower) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcPower, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10723,14 +11658,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcPower) namespace DcPowerMin { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcPowerMin) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcPowerMin, - sizeof(*dcPowerMin)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcPowerMin) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcPowerMin, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10738,14 +11672,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcPowerMin) namespace DcPowerMax { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcPowerMax) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcPowerMax, - sizeof(*dcPowerMax)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcPowerMax) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcPowerMax, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10753,14 +11686,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcPowerMax) namespace DcVoltageMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dcVoltageMultiplier) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcVoltageMultiplier, - sizeof(*dcVoltageMultiplier)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcVoltageMultiplier) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcVoltageMultiplier, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10768,14 +11700,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcVoltageMultiplier) namespace DcVoltageDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dcVoltageDivisor) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcVoltageDivisor, - sizeof(*dcVoltageDivisor)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcVoltageDivisor) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcVoltageDivisor, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10783,14 +11714,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcVoltageDivisor) namespace DcCurrentMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dcCurrentMultiplier) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcCurrentMultiplier, - sizeof(*dcCurrentMultiplier)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcCurrentMultiplier) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcCurrentMultiplier, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10798,14 +11728,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcCurrentMultiplier) namespace DcCurrentDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dcCurrentDivisor) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcCurrentDivisor, - sizeof(*dcCurrentDivisor)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcCurrentDivisor) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcCurrentDivisor, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10813,14 +11742,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcCurrentDivisor) namespace DcPowerMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dcPowerMultiplier) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcPowerMultiplier, - sizeof(*dcPowerMultiplier)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcPowerMultiplier) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcPowerMultiplier, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10828,14 +11756,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcPowerMultiplier) namespace DcPowerDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dcPowerDivisor) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) dcPowerDivisor, - sizeof(*dcPowerDivisor)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcPowerDivisor) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &dcPowerDivisor, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10843,14 +11770,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcPowerDivisor) namespace AcFrequency { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acFrequency) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acFrequency, - sizeof(*acFrequency)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequency) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acFrequency, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10858,14 +11784,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequency) namespace AcFrequencyMin { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acFrequencyMin) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acFrequencyMin, - sizeof(*acFrequencyMin)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequencyMin) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acFrequencyMin, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10873,14 +11798,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequencyMin) namespace AcFrequencyMax { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acFrequencyMax) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acFrequencyMax, - sizeof(*acFrequencyMax)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequencyMax) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acFrequencyMax, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10888,14 +11812,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequencyMax) namespace NeutralCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * neutralCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) neutralCurrent, - sizeof(*neutralCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t neutralCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &neutralCurrent, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -10903,14 +11826,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t neutralCurrent) namespace TotalActivePower { -EmberAfStatus Get(chip::EndpointId endpoint, int32_t * totalActivePower) +EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) totalActivePower, - sizeof(*totalActivePower)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int32_t totalActivePower) +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &totalActivePower, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); } @@ -10918,14 +11840,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int32_t totalActivePower) namespace TotalReactivePower { -EmberAfStatus Get(chip::EndpointId endpoint, int32_t * totalReactivePower) +EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) totalReactivePower, - sizeof(*totalReactivePower)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int32_t totalReactivePower) +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &totalReactivePower, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT32S_ATTRIBUTE_TYPE); } @@ -10933,14 +11854,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int32_t totalReactivePower) namespace TotalApparentPower { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * totalApparentPower) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) totalApparentPower, - sizeof(*totalApparentPower)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t totalApparentPower) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &totalApparentPower, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -10948,14 +11868,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t totalApparentPower) namespace Measured1stHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measured1stHarmonicCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) measured1stHarmonicCurrent, - sizeof(*measured1stHarmonicCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured1stHarmonicCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &measured1stHarmonicCurrent, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10963,14 +11882,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured1stHarmonicCurrent) namespace Measured3rdHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measured3rdHarmonicCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) measured3rdHarmonicCurrent, - sizeof(*measured3rdHarmonicCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured3rdHarmonicCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &measured3rdHarmonicCurrent, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10978,14 +11896,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured3rdHarmonicCurrent) namespace Measured5thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measured5thHarmonicCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) measured5thHarmonicCurrent, - sizeof(*measured5thHarmonicCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured5thHarmonicCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &measured5thHarmonicCurrent, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -10993,14 +11910,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured5thHarmonicCurrent) namespace Measured7thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measured7thHarmonicCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) measured7thHarmonicCurrent, - sizeof(*measured7thHarmonicCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured7thHarmonicCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &measured7thHarmonicCurrent, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11008,14 +11924,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured7thHarmonicCurrent) namespace Measured9thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measured9thHarmonicCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) measured9thHarmonicCurrent, - sizeof(*measured9thHarmonicCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured9thHarmonicCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &measured9thHarmonicCurrent, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11023,14 +11938,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured9thHarmonicCurrent) namespace Measured11thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measured11thHarmonicCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) measured11thHarmonicCurrent, - sizeof(*measured11thHarmonicCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured11thHarmonicCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &measured11thHarmonicCurrent, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11038,104 +11952,97 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured11thHarmonicCurrent namespace MeasuredPhase1stHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredPhase1stHarmonicCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) measuredPhase1stHarmonicCurrent, sizeof(*measuredPhase1stHarmonicCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredPhase1stHarmonicCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &measuredPhase1stHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredPhase1stHarmonicCurrent namespace MeasuredPhase3rdHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredPhase3rdHarmonicCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) measuredPhase3rdHarmonicCurrent, sizeof(*measuredPhase3rdHarmonicCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredPhase3rdHarmonicCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &measuredPhase3rdHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredPhase3rdHarmonicCurrent namespace MeasuredPhase5thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredPhase5thHarmonicCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) measuredPhase5thHarmonicCurrent, sizeof(*measuredPhase5thHarmonicCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredPhase5thHarmonicCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &measuredPhase5thHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredPhase5thHarmonicCurrent namespace MeasuredPhase7thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredPhase7thHarmonicCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) measuredPhase7thHarmonicCurrent, sizeof(*measuredPhase7thHarmonicCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredPhase7thHarmonicCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &measuredPhase7thHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredPhase7thHarmonicCurrent namespace MeasuredPhase9thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredPhase9thHarmonicCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) measuredPhase9thHarmonicCurrent, sizeof(*measuredPhase9thHarmonicCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredPhase9thHarmonicCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &measuredPhase9thHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredPhase9thHarmonicCurrent namespace MeasuredPhase11thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredPhase11thHarmonicCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) measuredPhase11thHarmonicCurrent, sizeof(*measuredPhase11thHarmonicCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredPhase11thHarmonicCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &measuredPhase11thHarmonicCurrent, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16S_ATTRIBUTE_TYPE); } } // namespace MeasuredPhase11thHarmonicCurrent namespace AcFrequencyMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acFrequencyMultiplier) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acFrequencyMultiplier, - sizeof(*acFrequencyMultiplier)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequencyMultiplier) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acFrequencyMultiplier, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11143,14 +12050,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequencyMultiplier) namespace AcFrequencyDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acFrequencyDivisor) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acFrequencyDivisor, - sizeof(*acFrequencyDivisor)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequencyDivisor) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acFrequencyDivisor, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11158,14 +12064,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequencyDivisor) namespace PowerMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * powerMultiplier) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) powerMultiplier, - sizeof(*powerMultiplier)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t powerMultiplier) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &powerMultiplier, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -11173,14 +12078,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t powerMultiplier) namespace PowerDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * powerDivisor) +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) powerDivisor, - sizeof(*powerDivisor)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t powerDivisor) +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &powerDivisor, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT32U_ATTRIBUTE_TYPE); } @@ -11188,14 +12092,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t powerDivisor) namespace HarmonicCurrentMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * harmonicCurrentMultiplier) +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) harmonicCurrentMultiplier, - sizeof(*harmonicCurrentMultiplier)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int8_t harmonicCurrentMultiplier) +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &harmonicCurrentMultiplier, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -11203,29 +12106,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t harmonicCurrentMultiplier) namespace PhaseHarmonicCurrentMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * phaseHarmonicCurrentMultiplier) +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) phaseHarmonicCurrentMultiplier, - sizeof(*phaseHarmonicCurrentMultiplier)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int8_t phaseHarmonicCurrentMultiplier) +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &phaseHarmonicCurrentMultiplier, ZCL_INT8S_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT8S_ATTRIBUTE_TYPE); } } // namespace PhaseHarmonicCurrentMultiplier namespace InstantaneousVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * instantaneousVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) instantaneousVoltage, - sizeof(*instantaneousVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t instantaneousVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &instantaneousVoltage, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11233,14 +12134,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t instantaneousVoltage) namespace InstantaneousLineCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * instantaneousLineCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) instantaneousLineCurrent, - sizeof(*instantaneousLineCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t instantaneousLineCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &instantaneousLineCurrent, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11248,14 +12148,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t instantaneousLineCurrent) namespace InstantaneousActiveCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * instantaneousActiveCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) instantaneousActiveCurrent, - sizeof(*instantaneousActiveCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t instantaneousActiveCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &instantaneousActiveCurrent, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11263,14 +12162,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t instantaneousActiveCurrent) namespace InstantaneousReactiveCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * instantaneousReactiveCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) instantaneousReactiveCurrent, - sizeof(*instantaneousReactiveCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t instantaneousReactiveCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &instantaneousReactiveCurrent, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11278,14 +12176,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t instantaneousReactiveCurren namespace InstantaneousPower { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * instantaneousPower) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) instantaneousPower, - sizeof(*instantaneousPower)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t instantaneousPower) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &instantaneousPower, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11293,14 +12190,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t instantaneousPower) namespace RmsVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltage, - sizeof(*rmsVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltage, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11308,14 +12204,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltage) namespace RmsVoltageMin { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageMin) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageMin, - sizeof(*rmsVoltageMin)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMin) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageMin, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11323,14 +12218,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMin) namespace RmsVoltageMax { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageMax) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageMax, - sizeof(*rmsVoltageMax)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMax) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageMax, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11338,14 +12232,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMax) namespace RmsCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrent) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsCurrent, - sizeof(*rmsCurrent)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrent) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsCurrent, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11353,14 +12246,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrent) namespace RmsCurrentMin { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentMin) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsCurrentMin, - sizeof(*rmsCurrentMin)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMin) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsCurrentMin, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11368,14 +12260,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMin) namespace RmsCurrentMax { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentMax) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsCurrentMax, - sizeof(*rmsCurrentMax)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMax) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsCurrentMax, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11383,14 +12274,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMax) namespace ActivePower { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePower) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) activePower, - sizeof(*activePower)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePower) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &activePower, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11398,14 +12288,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePower) namespace ActivePowerMin { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerMin) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) activePowerMin, - sizeof(*activePowerMin)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMin) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &activePowerMin, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11413,14 +12302,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMin) namespace ActivePowerMax { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerMax) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) activePowerMax, - sizeof(*activePowerMax)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMax) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &activePowerMax, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11428,14 +12316,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMax) namespace ReactivePower { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * reactivePower) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) reactivePower, - sizeof(*reactivePower)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactivePower) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &reactivePower, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11443,14 +12330,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactivePower) namespace ApparentPower { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * apparentPower) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) apparentPower, - sizeof(*apparentPower)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t apparentPower) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &apparentPower, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11458,14 +12344,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t apparentPower) namespace PowerFactor { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * powerFactor) +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) powerFactor, - sizeof(*powerFactor)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int8_t powerFactor) +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &powerFactor, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -11473,44 +12358,41 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t powerFactor) namespace AverageRmsVoltageMeasurementPeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsVoltageMeasurementPeriod) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) averageRmsVoltageMeasurementPeriod, sizeof(*averageRmsVoltageMeasurementPeriod)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsVoltageMeasurementPeriod) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &averageRmsVoltageMeasurementPeriod, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsVoltageMeasurementPeriod namespace AverageRmsUnderVoltageCounter { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsUnderVoltageCounter) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) averageRmsUnderVoltageCounter, - sizeof(*averageRmsUnderVoltageCounter)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsUnderVoltageCounter) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &averageRmsUnderVoltageCounter, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsUnderVoltageCounter namespace RmsExtremeOverVoltagePeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsExtremeOverVoltagePeriod) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsExtremeOverVoltagePeriod, - sizeof(*rmsExtremeOverVoltagePeriod)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeOverVoltagePeriod) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsExtremeOverVoltagePeriod, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11518,14 +12400,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeOverVoltagePerio namespace RmsExtremeUnderVoltagePeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsExtremeUnderVoltagePeriod) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsExtremeUnderVoltagePeriod, - sizeof(*rmsExtremeUnderVoltagePeriod)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeUnderVoltagePeriod) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsExtremeUnderVoltagePeriod, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11533,14 +12414,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeUnderVoltagePeri namespace RmsVoltageSagPeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageSagPeriod) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageSagPeriod, - sizeof(*rmsVoltageSagPeriod)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriod) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageSagPeriod, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11548,14 +12428,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriod) namespace RmsVoltageSwellPeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageSwellPeriod) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageSwellPeriod, - sizeof(*rmsVoltageSwellPeriod)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriod) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageSwellPeriod, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11563,14 +12442,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriod) namespace AcVoltageMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acVoltageMultiplier) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acVoltageMultiplier, - sizeof(*acVoltageMultiplier)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acVoltageMultiplier) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acVoltageMultiplier, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11578,14 +12456,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acVoltageMultiplier) namespace AcVoltageDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acVoltageDivisor) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acVoltageDivisor, - sizeof(*acVoltageDivisor)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acVoltageDivisor) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acVoltageDivisor, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11593,14 +12470,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acVoltageDivisor) namespace AcCurrentMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acCurrentMultiplier) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acCurrentMultiplier, - sizeof(*acCurrentMultiplier)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acCurrentMultiplier) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acCurrentMultiplier, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11608,14 +12484,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acCurrentMultiplier) namespace AcCurrentDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acCurrentDivisor) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acCurrentDivisor, - sizeof(*acCurrentDivisor)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acCurrentDivisor) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acCurrentDivisor, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11623,14 +12498,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acCurrentDivisor) namespace AcPowerMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acPowerMultiplier) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acPowerMultiplier, - sizeof(*acPowerMultiplier)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acPowerMultiplier) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acPowerMultiplier, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11638,14 +12512,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acPowerMultiplier) namespace AcPowerDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acPowerDivisor) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acPowerDivisor, - sizeof(*acPowerDivisor)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acPowerDivisor) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acPowerDivisor, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11653,14 +12526,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acPowerDivisor) namespace OverloadAlarmsMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * overloadAlarmsMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) overloadAlarmsMask, - sizeof(*overloadAlarmsMask)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t overloadAlarmsMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &overloadAlarmsMask, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_BITMAP8_ATTRIBUTE_TYPE); } @@ -11668,14 +12540,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t overloadAlarmsMask) namespace VoltageOverload { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * voltageOverload) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) voltageOverload, - sizeof(*voltageOverload)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t voltageOverload) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &voltageOverload, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11683,14 +12554,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t voltageOverload) namespace CurrentOverload { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * currentOverload) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) currentOverload, - sizeof(*currentOverload)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t currentOverload) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) ¤tOverload, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11698,14 +12568,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t currentOverload) namespace AcOverloadAlarmsMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acOverloadAlarmsMask) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acOverloadAlarmsMask, - sizeof(*acOverloadAlarmsMask)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acOverloadAlarmsMask) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acOverloadAlarmsMask, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_BITMAP16_ATTRIBUTE_TYPE); } @@ -11713,14 +12582,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acOverloadAlarmsMask) namespace AcVoltageOverload { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * acVoltageOverload) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acVoltageOverload, - sizeof(*acVoltageOverload)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t acVoltageOverload) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acVoltageOverload, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11728,14 +12596,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t acVoltageOverload) namespace AcCurrentOverload { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * acCurrentOverload) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acCurrentOverload, - sizeof(*acCurrentOverload)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t acCurrentOverload) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acCurrentOverload, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11743,14 +12610,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t acCurrentOverload) namespace AcActivePowerOverload { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * acActivePowerOverload) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acActivePowerOverload, - sizeof(*acActivePowerOverload)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t acActivePowerOverload) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acActivePowerOverload, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11758,14 +12624,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t acActivePowerOverload) namespace AcReactivePowerOverload { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * acReactivePowerOverload) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) acReactivePowerOverload, - sizeof(*acReactivePowerOverload)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t acReactivePowerOverload) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &acReactivePowerOverload, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11773,14 +12638,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t acReactivePowerOverload) namespace AverageRmsOverVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * averageRmsOverVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) averageRmsOverVoltage, - sizeof(*averageRmsOverVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t averageRmsOverVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &averageRmsOverVoltage, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11788,14 +12652,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t averageRmsOverVoltage) namespace AverageRmsUnderVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * averageRmsUnderVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) averageRmsUnderVoltage, - sizeof(*averageRmsUnderVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t averageRmsUnderVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &averageRmsUnderVoltage, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11803,14 +12666,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t averageRmsUnderVoltage) namespace RmsExtremeOverVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * rmsExtremeOverVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsExtremeOverVoltage, - sizeof(*rmsExtremeOverVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t rmsExtremeOverVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsExtremeOverVoltage, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11818,14 +12680,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t rmsExtremeOverVoltage) namespace RmsExtremeUnderVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * rmsExtremeUnderVoltage) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsExtremeUnderVoltage, - sizeof(*rmsExtremeUnderVoltage)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t rmsExtremeUnderVoltage) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsExtremeUnderVoltage, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11833,14 +12694,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t rmsExtremeUnderVoltage) namespace RmsVoltageSag { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * rmsVoltageSag) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageSag, - sizeof(*rmsVoltageSag)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t rmsVoltageSag) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageSag, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11848,14 +12708,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t rmsVoltageSag) namespace RmsVoltageSwell { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * rmsVoltageSwell) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageSwell, - sizeof(*rmsVoltageSwell)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t rmsVoltageSwell) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageSwell, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11863,14 +12722,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t rmsVoltageSwell) namespace LineCurrentPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * lineCurrentPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) lineCurrentPhaseB, - sizeof(*lineCurrentPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t lineCurrentPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &lineCurrentPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11878,14 +12736,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t lineCurrentPhaseB) namespace ActiveCurrentPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activeCurrentPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) activeCurrentPhaseB, - sizeof(*activeCurrentPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activeCurrentPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &activeCurrentPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11893,14 +12750,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t activeCurrentPhaseB) namespace ReactiveCurrentPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * reactiveCurrentPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) reactiveCurrentPhaseB, - sizeof(*reactiveCurrentPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactiveCurrentPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &reactiveCurrentPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -11908,14 +12764,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactiveCurrentPhaseB) namespace RmsVoltagePhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltagePhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltagePhaseB, - sizeof(*rmsVoltagePhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltagePhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltagePhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11923,14 +12778,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltagePhaseB) namespace RmsVoltageMinPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageMinPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageMinPhaseB, - sizeof(*rmsVoltageMinPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMinPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageMinPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11938,14 +12792,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMinPhaseB) namespace RmsVoltageMaxPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageMaxPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageMaxPhaseB, - sizeof(*rmsVoltageMaxPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMaxPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageMaxPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11953,14 +12806,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMaxPhaseB) namespace RmsCurrentPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsCurrentPhaseB, - sizeof(*rmsCurrentPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsCurrentPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11968,14 +12820,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentPhaseB) namespace RmsCurrentMinPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentMinPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsCurrentMinPhaseB, - sizeof(*rmsCurrentMinPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMinPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsCurrentMinPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11983,14 +12834,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMinPhaseB) namespace RmsCurrentMaxPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentMaxPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsCurrentMaxPhaseB, - sizeof(*rmsCurrentMaxPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMaxPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsCurrentMaxPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -11998,14 +12848,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMaxPhaseB) namespace ActivePowerPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) activePowerPhaseB, - sizeof(*activePowerPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &activePowerPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12013,14 +12862,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerPhaseB) namespace ActivePowerMinPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerMinPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) activePowerMinPhaseB, - sizeof(*activePowerMinPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMinPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &activePowerMinPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12028,14 +12876,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMinPhaseB) namespace ActivePowerMaxPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerMaxPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) activePowerMaxPhaseB, - sizeof(*activePowerMaxPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMaxPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &activePowerMaxPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12043,14 +12890,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMaxPhaseB) namespace ReactivePowerPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * reactivePowerPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) reactivePowerPhaseB, - sizeof(*reactivePowerPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactivePowerPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &reactivePowerPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12058,14 +12904,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactivePowerPhaseB) namespace ApparentPowerPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * apparentPowerPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) apparentPowerPhaseB, - sizeof(*apparentPowerPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t apparentPowerPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &apparentPowerPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12073,14 +12918,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t apparentPowerPhaseB) namespace PowerFactorPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * powerFactorPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) powerFactorPhaseB, - sizeof(*powerFactorPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int8_t powerFactorPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &powerFactorPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -12088,91 +12932,83 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t powerFactorPhaseB) namespace AverageRmsVoltageMeasurementPeriodPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsVoltageMeasurementPeriodPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) averageRmsVoltageMeasurementPeriodPhaseB, - sizeof(*averageRmsVoltageMeasurementPeriodPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsVoltageMeasurementPeriodPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &averageRmsVoltageMeasurementPeriodPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsVoltageMeasurementPeriodPhaseB namespace AverageRmsOverVoltageCounterPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsOverVoltageCounterPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) averageRmsOverVoltageCounterPhaseB, sizeof(*averageRmsOverVoltageCounterPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsOverVoltageCounterPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &averageRmsOverVoltageCounterPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsOverVoltageCounterPhaseB namespace AverageRmsUnderVoltageCounterPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsUnderVoltageCounterPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) averageRmsUnderVoltageCounterPhaseB, - sizeof(*averageRmsUnderVoltageCounterPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsUnderVoltageCounterPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &averageRmsUnderVoltageCounterPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsUnderVoltageCounterPhaseB namespace RmsExtremeOverVoltagePeriodPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsExtremeOverVoltagePeriodPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) rmsExtremeOverVoltagePeriodPhaseB, sizeof(*rmsExtremeOverVoltagePeriodPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeOverVoltagePeriodPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &rmsExtremeOverVoltagePeriodPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsExtremeOverVoltagePeriodPhaseB namespace RmsExtremeUnderVoltagePeriodPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsExtremeUnderVoltagePeriodPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) rmsExtremeUnderVoltagePeriodPhaseB, sizeof(*rmsExtremeUnderVoltagePeriodPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeUnderVoltagePeriodPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &rmsExtremeUnderVoltagePeriodPhaseB, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsExtremeUnderVoltagePeriodPhaseB namespace RmsVoltageSagPeriodPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageSagPeriodPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageSagPeriodPhaseB, - sizeof(*rmsVoltageSagPeriodPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriodPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageSagPeriodPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12180,14 +13016,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriodPhaseB) namespace RmsVoltageSwellPeriodPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageSwellPeriodPhaseB) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageSwellPeriodPhaseB, - sizeof(*rmsVoltageSwellPeriodPhaseB)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriodPhaseB) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageSwellPeriodPhaseB, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12195,14 +13030,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriodPhase namespace LineCurrentPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * lineCurrentPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) lineCurrentPhaseC, - sizeof(*lineCurrentPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t lineCurrentPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &lineCurrentPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12210,14 +13044,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t lineCurrentPhaseC) namespace ActiveCurrentPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activeCurrentPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) activeCurrentPhaseC, - sizeof(*activeCurrentPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activeCurrentPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &activeCurrentPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12225,14 +13058,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t activeCurrentPhaseC) namespace ReactiveCurrentPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * reactiveCurrentPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) reactiveCurrentPhaseC, - sizeof(*reactiveCurrentPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactiveCurrentPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &reactiveCurrentPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12240,14 +13072,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactiveCurrentPhaseC) namespace RmsVoltagePhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltagePhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltagePhaseC, - sizeof(*rmsVoltagePhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltagePhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltagePhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12255,14 +13086,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltagePhaseC) namespace RmsVoltageMinPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageMinPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageMinPhaseC, - sizeof(*rmsVoltageMinPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMinPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageMinPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12270,14 +13100,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMinPhaseC) namespace RmsVoltageMaxPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageMaxPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageMaxPhaseC, - sizeof(*rmsVoltageMaxPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMaxPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageMaxPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12285,14 +13114,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMaxPhaseC) namespace RmsCurrentPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsCurrentPhaseC, - sizeof(*rmsCurrentPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsCurrentPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12300,14 +13128,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentPhaseC) namespace RmsCurrentMinPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentMinPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsCurrentMinPhaseC, - sizeof(*rmsCurrentMinPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMinPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsCurrentMinPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12315,14 +13142,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMinPhaseC) namespace RmsCurrentMaxPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentMaxPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsCurrentMaxPhaseC, - sizeof(*rmsCurrentMaxPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMaxPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsCurrentMaxPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12330,14 +13156,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMaxPhaseC) namespace ActivePowerPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) activePowerPhaseC, - sizeof(*activePowerPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &activePowerPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12345,14 +13170,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerPhaseC) namespace ActivePowerMinPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerMinPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) activePowerMinPhaseC, - sizeof(*activePowerMinPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMinPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &activePowerMinPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12360,14 +13184,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMinPhaseC) namespace ActivePowerMaxPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerMaxPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) activePowerMaxPhaseC, - sizeof(*activePowerMaxPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMaxPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &activePowerMaxPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12375,14 +13198,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMaxPhaseC) namespace ReactivePowerPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * reactivePowerPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) reactivePowerPhaseC, - sizeof(*reactivePowerPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactivePowerPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &reactivePowerPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16S_ATTRIBUTE_TYPE); } @@ -12390,14 +13212,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactivePowerPhaseC) namespace ApparentPowerPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * apparentPowerPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) apparentPowerPhaseC, - sizeof(*apparentPowerPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t apparentPowerPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &apparentPowerPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12405,14 +13226,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t apparentPowerPhaseC) namespace PowerFactorPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * powerFactorPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) powerFactorPhaseC, - sizeof(*powerFactorPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, int8_t powerFactorPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &powerFactorPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT8S_ATTRIBUTE_TYPE); } @@ -12420,91 +13240,83 @@ EmberAfStatus Set(chip::EndpointId endpoint, int8_t powerFactorPhaseC) namespace AverageRmsVoltageMeasurementPeriodPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsVoltageMeasurementPeriodPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) averageRmsVoltageMeasurementPeriodPhaseC, - sizeof(*averageRmsVoltageMeasurementPeriodPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsVoltageMeasurementPeriodPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &averageRmsVoltageMeasurementPeriodPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsVoltageMeasurementPeriodPhaseC namespace AverageRmsOverVoltageCounterPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsOverVoltageCounterPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) averageRmsOverVoltageCounterPhaseC, sizeof(*averageRmsOverVoltageCounterPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsOverVoltageCounterPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &averageRmsOverVoltageCounterPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsOverVoltageCounterPhaseC namespace AverageRmsUnderVoltageCounterPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsUnderVoltageCounterPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) averageRmsUnderVoltageCounterPhaseC, - sizeof(*averageRmsUnderVoltageCounterPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsUnderVoltageCounterPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &averageRmsUnderVoltageCounterPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace AverageRmsUnderVoltageCounterPhaseC namespace RmsExtremeOverVoltagePeriodPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsExtremeOverVoltagePeriodPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) rmsExtremeOverVoltagePeriodPhaseC, sizeof(*rmsExtremeOverVoltagePeriodPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeOverVoltagePeriodPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &rmsExtremeOverVoltagePeriodPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsExtremeOverVoltagePeriodPhaseC namespace RmsExtremeUnderVoltagePeriodPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsExtremeUnderVoltagePeriodPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) rmsExtremeUnderVoltagePeriodPhaseC, sizeof(*rmsExtremeUnderVoltagePeriodPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeUnderVoltagePeriodPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, - (uint8_t *) &rmsExtremeUnderVoltagePeriodPhaseC, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, + ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace RmsExtremeUnderVoltagePeriodPhaseC namespace RmsVoltageSagPeriodPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageSagPeriodPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageSagPeriodPhaseC, - sizeof(*rmsVoltageSagPeriodPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriodPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageSagPeriodPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12512,14 +13324,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriodPhaseC) namespace RmsVoltageSwellPeriodPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageSwellPeriodPhaseC) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) rmsVoltageSwellPeriodPhaseC, - sizeof(*rmsVoltageSwellPeriodPhaseC)); + return emberAfReadServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriodPhaseC) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &rmsVoltageSwellPeriodPhaseC, + return emberAfWriteServerAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12539,14 +13350,13 @@ namespace Attributes { namespace EmberSampleAttribute { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * emberSampleAttribute) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) emberSampleAttribute, - sizeof(*emberSampleAttribute)); + return emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t emberSampleAttribute) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) &emberSampleAttribute, + return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -12554,14 +13364,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t emberSampleAttribute) namespace EmberSampleAttribute2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * emberSampleAttribute2) +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) emberSampleAttribute2, - sizeof(*emberSampleAttribute2)); + return emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t emberSampleAttribute2) +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) &emberSampleAttribute2, + return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster::Id, Id, (uint8_t *) &value, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -12575,14 +13384,13 @@ namespace Attributes { namespace EmberSampleAttribute3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * emberSampleAttribute3) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) emberSampleAttribute3, - sizeof(*emberSampleAttribute3)); + return emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t emberSampleAttribute3) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) &emberSampleAttribute3, + return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -12590,14 +13398,13 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t emberSampleAttribute3) namespace EmberSampleAttribute4 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * emberSampleAttribute4) +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) { - return emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) emberSampleAttribute4, - sizeof(*emberSampleAttribute4)); + return emberAfReadServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) value, sizeof(*value)); } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t emberSampleAttribute4) +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) { - return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) &emberSampleAttribute4, + return emberAfWriteServerAttribute(endpoint, Clusters::SampleMfgSpecificCluster2::Id, Id, (uint8_t *) &value, ZCL_INT16U_ATTRIBUTE_TYPE); } 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 f6228e6328a6ac..f6e9e2f7ad5284 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 @@ -35,273 +35,288 @@ namespace PowerConfiguration { namespace Attributes { namespace MainsVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * mainsVoltage); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t mainsVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MainsVoltage namespace MainsFrequency { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * mainsFrequency); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t mainsFrequency); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MainsFrequency namespace MainsAlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * mainsAlarmMask); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t mainsAlarmMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MainsAlarmMask namespace MainsVoltageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * mainsVoltageMinThreshold); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t mainsVoltageMinThreshold); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MainsVoltageMinThreshold namespace MainsVoltageMaxThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * mainsVoltageMaxThreshold); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t mainsVoltageMaxThreshold); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MainsVoltageMaxThreshold namespace MainsVoltageDwellTrip { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * mainsVoltageDwellTrip); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t mainsVoltageDwellTrip); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MainsVoltageDwellTrip namespace BatteryVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryVoltage); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryVoltage namespace BatteryPercentageRemaining { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryPercentageRemaining); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageRemaining); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryPercentageRemaining +namespace BatteryManufacturer { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace BatteryManufacturer + namespace BatterySize { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batterySize); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batterySize); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatterySize namespace BatteryAhrRating { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * batteryAhrRating); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t batteryAhrRating); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace BatteryAhrRating namespace BatteryQuantity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryQuantity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryQuantity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryQuantity namespace BatteryRatedVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryRatedVoltage); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryRatedVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryRatedVoltage namespace BatteryAlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryAlarmMask); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryAlarmMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryAlarmMask namespace BatteryVoltageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryVoltageMinThreshold); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltageMinThreshold); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryVoltageMinThreshold namespace BatteryVoltageThreshold1 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryVoltageThreshold1); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold1); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryVoltageThreshold1 namespace BatteryVoltageThreshold2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryVoltageThreshold2); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold2); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryVoltageThreshold2 namespace BatteryVoltageThreshold3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryVoltageThreshold3); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryVoltageThreshold3); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryVoltageThreshold3 namespace BatteryPercentageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryPercentageMinThreshold); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageMinThreshold); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryPercentageMinThreshold namespace BatteryPercentageThreshold1 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryPercentageThreshold1); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold1); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryPercentageThreshold1 namespace BatteryPercentageThreshold2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryPercentageThreshold2); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold2); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryPercentageThreshold2 namespace BatteryPercentageThreshold3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryPercentageThreshold3); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentageThreshold3); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryPercentageThreshold3 namespace BatteryAlarmState { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryAlarmState); // bitmap32 -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryAlarmState); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace BatteryAlarmState namespace Battery2Voltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2Voltage); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2Voltage); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2Voltage namespace Battery2PercentageRemaining { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2PercentageRemaining); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageRemaining); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2PercentageRemaining +namespace Battery2Manufacturer { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace Battery2Manufacturer + namespace Battery2Size { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2Size); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2Size); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2Size namespace Battery2AhrRating { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * battery2AhrRating); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t battery2AhrRating); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Battery2AhrRating namespace Battery2Quantity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2Quantity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2Quantity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2Quantity namespace Battery2RatedVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2RatedVoltage); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2RatedVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2RatedVoltage namespace Battery2AlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2AlarmMask); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2AlarmMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2AlarmMask namespace Battery2VoltageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2VoltageMinThreshold); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2VoltageMinThreshold); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2VoltageMinThreshold namespace Battery2VoltageThreshold1 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2VoltageThreshold1); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold1); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2VoltageThreshold1 namespace Battery2VoltageThreshold2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2VoltageThreshold2); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold2); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2VoltageThreshold2 namespace Battery2VoltageThreshold3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2VoltageThreshold3); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2VoltageThreshold3); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2VoltageThreshold3 namespace Battery2PercentageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2PercentageMinThreshold); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageMinThreshold); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2PercentageMinThreshold namespace Battery2PercentageThreshold1 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2PercentageThreshold1); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold1); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2PercentageThreshold1 namespace Battery2PercentageThreshold2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2PercentageThreshold2); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold2); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2PercentageThreshold2 namespace Battery2PercentageThreshold3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery2PercentageThreshold3); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery2PercentageThreshold3); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery2PercentageThreshold3 namespace Battery2AlarmState { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * battery2AlarmState); // bitmap32 -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t battery2AlarmState); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace Battery2AlarmState namespace Battery3Voltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3Voltage); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3Voltage); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3Voltage namespace Battery3PercentageRemaining { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3PercentageRemaining); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageRemaining); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3PercentageRemaining +namespace Battery3Manufacturer { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace Battery3Manufacturer + namespace Battery3Size { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3Size); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3Size); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3Size namespace Battery3AhrRating { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * battery3AhrRating); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t battery3AhrRating); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Battery3AhrRating namespace Battery3Quantity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3Quantity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3Quantity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3Quantity namespace Battery3RatedVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3RatedVoltage); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3RatedVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3RatedVoltage namespace Battery3AlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3AlarmMask); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3AlarmMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3AlarmMask namespace Battery3VoltageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3VoltageMinThreshold); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3VoltageMinThreshold); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3VoltageMinThreshold namespace Battery3VoltageThreshold1 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3VoltageThreshold1); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold1); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3VoltageThreshold1 namespace Battery3VoltageThreshold2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3VoltageThreshold2); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold2); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3VoltageThreshold2 namespace Battery3VoltageThreshold3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3VoltageThreshold3); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3VoltageThreshold3); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3VoltageThreshold3 namespace Battery3PercentageMinThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3PercentageMinThreshold); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageMinThreshold); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3PercentageMinThreshold namespace Battery3PercentageThreshold1 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3PercentageThreshold1); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold1); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3PercentageThreshold1 namespace Battery3PercentageThreshold2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3PercentageThreshold2); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold2); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3PercentageThreshold2 namespace Battery3PercentageThreshold3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * battery3PercentageThreshold3); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t battery3PercentageThreshold3); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Battery3PercentageThreshold3 namespace Battery3AlarmState { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * battery3AlarmState); // bitmap32 -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t battery3AlarmState); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace Battery3AlarmState } // namespace Attributes @@ -311,38 +326,38 @@ namespace DeviceTemperatureConfiguration { namespace Attributes { namespace CurrentTemperature { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * currentTemperature); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t currentTemperature); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace CurrentTemperature namespace MinTempExperienced { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minTempExperienced); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minTempExperienced); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MinTempExperienced namespace MaxTempExperienced { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxTempExperienced); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxTempExperienced); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MaxTempExperienced namespace OverTempTotalDwell { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * overTempTotalDwell); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t overTempTotalDwell); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace OverTempTotalDwell namespace DeviceTempAlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * deviceTempAlarmMask); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t deviceTempAlarmMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace DeviceTempAlarmMask namespace LowTempThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * lowTempThreshold); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t lowTempThreshold); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace LowTempThreshold namespace HighTempThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * highTempThreshold); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t highTempThreshold); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace HighTempThreshold } // namespace Attributes @@ -352,13 +367,13 @@ namespace Identify { namespace Attributes { namespace IdentifyTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * identifyTime); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t identifyTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace IdentifyTime namespace IdentifyType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * identifyType); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t identifyType); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace IdentifyType } // namespace Attributes @@ -368,8 +383,8 @@ namespace Groups { namespace Attributes { namespace NameSupport { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * nameSupport); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t nameSupport); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace NameSupport } // namespace Attributes @@ -379,33 +394,33 @@ namespace Scenes { namespace Attributes { namespace SceneCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * sceneCount); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t sceneCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace SceneCount namespace CurrentScene { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentScene); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentScene); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CurrentScene namespace CurrentGroup { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentGroup); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentGroup); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace CurrentGroup namespace SceneValid { -EmberAfStatus Get(chip::EndpointId endpoint, bool * sceneValid); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool sceneValid); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace SceneValid namespace NameSupport { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * nameSupport); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t nameSupport); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace NameSupport namespace LastConfiguredBy { -EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * lastConfiguredBy); // node_id -EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId lastConfiguredBy); +EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * value); // node_id +EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId value); } // namespace LastConfiguredBy } // namespace Attributes @@ -415,48 +430,48 @@ namespace OnOff { namespace Attributes { namespace OnOff { -EmberAfStatus Get(chip::EndpointId endpoint, bool * onOff); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool onOff); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace OnOff namespace SampleMfgSpecificAttribute0x00000x1002 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * sampleMfgSpecificAttribute0x00000x1002); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t sampleMfgSpecificAttribute0x00000x1002); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace SampleMfgSpecificAttribute0x00000x1002 namespace SampleMfgSpecificAttribute0x00000x1049 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * sampleMfgSpecificAttribute0x00000x1049); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t sampleMfgSpecificAttribute0x00000x1049); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace SampleMfgSpecificAttribute0x00000x1049 namespace SampleMfgSpecificAttribute0x00010x1002 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * sampleMfgSpecificAttribute0x00010x1002); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t sampleMfgSpecificAttribute0x00010x1002); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace SampleMfgSpecificAttribute0x00010x1002 namespace SampleMfgSpecificAttribute0x00010x1040 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * sampleMfgSpecificAttribute0x00010x1040); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t sampleMfgSpecificAttribute0x00010x1040); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace SampleMfgSpecificAttribute0x00010x1040 namespace GlobalSceneControl { -EmberAfStatus Get(chip::EndpointId endpoint, bool * globalSceneControl); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool globalSceneControl); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace GlobalSceneControl namespace OnTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * onTime); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t onTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace OnTime namespace OffWaitTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * offWaitTime); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t offWaitTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace OffWaitTime namespace StartUpOnOff { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * startUpOnOff); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t startUpOnOff); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace StartUpOnOff } // namespace Attributes @@ -466,13 +481,13 @@ namespace OnOffSwitchConfiguration { namespace Attributes { namespace SwitchType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * switchType); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t switchType); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace SwitchType namespace SwitchActions { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * switchActions); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t switchActions); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace SwitchActions } // namespace Attributes @@ -482,73 +497,73 @@ namespace LevelControl { namespace Attributes { namespace CurrentLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentLevel); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentLevel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CurrentLevel namespace RemainingTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * remainingTime); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t remainingTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RemainingTime namespace MinLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * minLevel); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t minLevel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MinLevel namespace MaxLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * maxLevel); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t maxLevel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MaxLevel namespace CurrentFrequency { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentFrequency); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentFrequency); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace CurrentFrequency namespace MinFrequency { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * minFrequency); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minFrequency); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MinFrequency namespace MaxFrequency { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxFrequency); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxFrequency); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MaxFrequency namespace Options { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * options); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t options); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Options namespace OnOffTransitionTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * onOffTransitionTime); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t onOffTransitionTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace OnOffTransitionTime namespace OnLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * onLevel); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t onLevel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace OnLevel namespace OnTransitionTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * onTransitionTime); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t onTransitionTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace OnTransitionTime namespace OffTransitionTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * offTransitionTime); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t offTransitionTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace OffTransitionTime namespace DefaultMoveRate { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * defaultMoveRate); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t defaultMoveRate); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace DefaultMoveRate namespace StartUpCurrentLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * startUpCurrentLevel); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t startUpCurrentLevel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace StartUpCurrentLevel } // namespace Attributes @@ -558,8 +573,8 @@ namespace Alarms { namespace Attributes { namespace AlarmCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * alarmCount); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t alarmCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AlarmCount } // namespace Attributes @@ -569,53 +584,53 @@ namespace Time { namespace Attributes { namespace Time { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * time); // epoch_s -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t time); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // epoch_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace Time namespace TimeStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * timeStatus); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t timeStatus); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace TimeStatus namespace TimeZone { -EmberAfStatus Get(chip::EndpointId endpoint, int32_t * timeZone); // int32s -EmberAfStatus Set(chip::EndpointId endpoint, int32_t timeZone); +EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value); // int32s +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value); } // namespace TimeZone namespace DstStart { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * dstStart); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t dstStart); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace DstStart namespace DstEnd { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * dstEnd); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t dstEnd); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace DstEnd namespace DstShift { -EmberAfStatus Get(chip::EndpointId endpoint, int32_t * dstShift); // int32s -EmberAfStatus Set(chip::EndpointId endpoint, int32_t dstShift); +EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value); // int32s +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value); } // namespace DstShift namespace StandardTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * standardTime); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t standardTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace StandardTime namespace LocalTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * localTime); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t localTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace LocalTime namespace LastSetTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * lastSetTime); // epoch_s -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t lastSetTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // epoch_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace LastSetTime namespace ValidUntilTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * validUntilTime); // epoch_s -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t validUntilTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // epoch_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace ValidUntilTime } // namespace Attributes @@ -624,34 +639,49 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t validUntilTime); namespace BinaryInputBasic { namespace Attributes { +namespace ActiveText { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace ActiveText + +namespace Description { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace Description + +namespace InactiveText { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace InactiveText + namespace OutOfService { -EmberAfStatus Get(chip::EndpointId endpoint, bool * outOfService); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool outOfService); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace OutOfService namespace Polarity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * polarity); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t polarity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Polarity namespace PresentValue { -EmberAfStatus Get(chip::EndpointId endpoint, bool * presentValue); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool presentValue); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace PresentValue namespace Reliability { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * reliability); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t reliability); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Reliability namespace StatusFlags { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * statusFlags); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t statusFlags); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace StatusFlags namespace ApplicationType { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * applicationType); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t applicationType); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace ApplicationType } // namespace Attributes @@ -661,28 +691,28 @@ namespace PowerProfile { namespace Attributes { namespace TotalProfileNum { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * totalProfileNum); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t totalProfileNum); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace TotalProfileNum namespace MultipleScheduling { -EmberAfStatus Get(chip::EndpointId endpoint, bool * multipleScheduling); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool multipleScheduling); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace MultipleScheduling namespace EnergyFormatting { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * energyFormatting); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t energyFormatting); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace EnergyFormatting namespace EnergyRemote { -EmberAfStatus Get(chip::EndpointId endpoint, bool * energyRemote); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool energyRemote); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace EnergyRemote namespace ScheduleMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * scheduleMode); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t scheduleMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ScheduleMode } // namespace Attributes @@ -692,18 +722,18 @@ namespace ApplianceControl { namespace Attributes { namespace StartTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * startTime); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t startTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace StartTime namespace FinishTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * finishTime); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t finishTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace FinishTime namespace RemainingTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * remainingTime); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t remainingTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RemainingTime } // namespace Attributes @@ -719,38 +749,38 @@ namespace PollControl { namespace Attributes { namespace CheckInInterval { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * checkInInterval); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t checkInInterval); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace CheckInInterval namespace LongPollInterval { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * longPollInterval); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t longPollInterval); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace LongPollInterval namespace ShortPollInterval { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * shortPollInterval); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t shortPollInterval); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ShortPollInterval namespace FastPollTimeout { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * fastPollTimeout); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t fastPollTimeout); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace FastPollTimeout namespace CheckInIntervalMin { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * checkInIntervalMin); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t checkInIntervalMin); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace CheckInIntervalMin namespace LongPollIntervalMin { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * longPollIntervalMin); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t longPollIntervalMin); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace LongPollIntervalMin namespace FastPollTimeoutMax { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * fastPollTimeoutMax); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t fastPollTimeoutMax); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace FastPollTimeoutMax } // namespace Attributes @@ -760,38 +790,93 @@ namespace Basic { namespace Attributes { namespace InteractionModelVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * interactionModelVersion); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t interactionModelVersion); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace InteractionModelVersion +namespace VendorName { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace VendorName + namespace VendorID { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * vendorID); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t vendorID); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace VendorID +namespace ProductName { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace ProductName + namespace ProductID { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * productID); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t productID); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ProductID +namespace UserLabel { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace UserLabel + +namespace Location { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace Location + namespace HardwareVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * hardwareVersion); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t hardwareVersion); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace HardwareVersion +namespace HardwareVersionString { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace HardwareVersionString + namespace SoftwareVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * softwareVersion); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t softwareVersion); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace SoftwareVersion +namespace SoftwareVersionString { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace SoftwareVersionString + +namespace ManufacturingDate { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace ManufacturingDate + +namespace PartNumber { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace PartNumber + +namespace ProductURL { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace ProductURL + +namespace ProductLabel { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace ProductLabel + +namespace SerialNumber { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace SerialNumber + namespace LocalConfigDisabled { -EmberAfStatus Get(chip::EndpointId endpoint, bool * localConfigDisabled); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool localConfigDisabled); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace LocalConfigDisabled namespace Reachable { -EmberAfStatus Get(chip::EndpointId endpoint, bool * reachable); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool reachable); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace Reachable } // namespace Attributes @@ -800,9 +885,14 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool reachable); namespace OtaSoftwareUpdateRequestor { namespace Attributes { +namespace DefaultOtaProvider { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace DefaultOtaProvider + namespace UpdatePossible { -EmberAfStatus Get(chip::EndpointId endpoint, bool * updatePossible); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool updatePossible); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace UpdatePossible } // namespace Attributes @@ -812,123 +902,143 @@ namespace PowerSource { namespace Attributes { namespace Status { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * status); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t status); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Status namespace Order { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * order); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t order); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Order +namespace Description { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace Description + namespace WiredAssessedInputVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * wiredAssessedInputVoltage); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t wiredAssessedInputVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace WiredAssessedInputVoltage namespace WiredAssessedInputFrequency { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * wiredAssessedInputFrequency); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t wiredAssessedInputFrequency); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace WiredAssessedInputFrequency namespace WiredCurrentType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * wiredCurrentType); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t wiredCurrentType); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace WiredCurrentType namespace WiredAssessedCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * wiredAssessedCurrent); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t wiredAssessedCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace WiredAssessedCurrent namespace WiredNominalVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * wiredNominalVoltage); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t wiredNominalVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace WiredNominalVoltage namespace WiredMaximumCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * wiredMaximumCurrent); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t wiredMaximumCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace WiredMaximumCurrent namespace WiredPresent { -EmberAfStatus Get(chip::EndpointId endpoint, bool * wiredPresent); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool wiredPresent); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace WiredPresent namespace BatteryVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryVoltage); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace BatteryVoltage namespace BatteryPercentRemaining { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryPercentRemaining); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryPercentRemaining); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryPercentRemaining namespace BatteryTimeRemaining { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryTimeRemaining); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryTimeRemaining); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace BatteryTimeRemaining namespace BatteryChargeLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryChargeLevel); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryChargeLevel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryChargeLevel namespace BatteryReplacementNeeded { -EmberAfStatus Get(chip::EndpointId endpoint, bool * batteryReplacementNeeded); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool batteryReplacementNeeded); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace BatteryReplacementNeeded namespace BatteryReplaceability { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryReplaceability); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryReplaceability); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryReplaceability namespace BatteryPresent { -EmberAfStatus Get(chip::EndpointId endpoint, bool * batteryPresent); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool batteryPresent); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace BatteryPresent +namespace BatteryReplacementDescription { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace BatteryReplacementDescription + namespace BatteryCommonDesignation { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryCommonDesignation); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryCommonDesignation); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace BatteryCommonDesignation +namespace BatteryANSIDesignation { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace BatteryANSIDesignation + +namespace BatteryIECDesignation { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace BatteryIECDesignation + namespace BatteryApprovedChemistry { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryApprovedChemistry); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryApprovedChemistry); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace BatteryApprovedChemistry namespace BatteryCapacity { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryCapacity); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryCapacity); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace BatteryCapacity namespace BatteryQuantity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryQuantity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryQuantity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryQuantity namespace BatteryChargeState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * batteryChargeState); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t batteryChargeState); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BatteryChargeState namespace BatteryTimeToFullCharge { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryTimeToFullCharge); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryTimeToFullCharge); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace BatteryTimeToFullCharge namespace BatteryFunctionalWhileCharging { -EmberAfStatus Get(chip::EndpointId endpoint, bool * batteryFunctionalWhileCharging); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool batteryFunctionalWhileCharging); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace BatteryFunctionalWhileCharging namespace BatteryChargingCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * batteryChargingCurrent); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t batteryChargingCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace BatteryChargingCurrent } // namespace Attributes @@ -938,8 +1048,8 @@ namespace GeneralCommissioning { namespace Attributes { namespace Breadcrumb { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * breadcrumb); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t breadcrumb); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace Breadcrumb } // namespace Attributes @@ -949,23 +1059,23 @@ namespace GeneralDiagnostics { namespace Attributes { namespace RebootCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rebootCount); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rebootCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RebootCount namespace UpTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * upTime); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t upTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace UpTime namespace TotalOperationalHours { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * totalOperationalHours); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t totalOperationalHours); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TotalOperationalHours namespace BootReasons { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * bootReasons); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t bootReasons); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BootReasons } // namespace Attributes @@ -975,18 +1085,18 @@ namespace SoftwareDiagnostics { namespace Attributes { namespace CurrentHeapFree { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * currentHeapFree); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t currentHeapFree); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace CurrentHeapFree namespace CurrentHeapUsed { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * currentHeapUsed); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t currentHeapUsed); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace CurrentHeapUsed namespace CurrentHeapHighWatermark { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * currentHeapHighWatermark); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t currentHeapHighWatermark); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace CurrentHeapHighWatermark } // namespace Attributes @@ -996,344 +1106,364 @@ namespace ThreadNetworkDiagnostics { namespace Attributes { namespace Channel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * channel); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t channel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Channel namespace RoutingRole { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * routingRole); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t routingRole); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace RoutingRole +namespace NetworkName { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace NetworkName + namespace PanId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * panId); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t panId); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace PanId namespace ExtendedPanId { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * extendedPanId); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t extendedPanId); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace ExtendedPanId +namespace MeshLocalPrefix { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace MeshLocalPrefix + namespace OverrunCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * overrunCount); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t overrunCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace OverrunCount namespace PartitionId { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * partitionId); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t partitionId); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace PartitionId namespace Weighting { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * weighting); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t weighting); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Weighting namespace DataVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * dataVersion); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dataVersion); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace DataVersion namespace StableDataVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * stableDataVersion); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t stableDataVersion); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace StableDataVersion namespace LeaderRouterId { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * leaderRouterId); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t leaderRouterId); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace LeaderRouterId namespace DetachedRoleCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * detachedRoleCount); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t detachedRoleCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace DetachedRoleCount namespace ChildRoleCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * childRoleCount); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t childRoleCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ChildRoleCount namespace RouterRoleCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * routerRoleCount); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t routerRoleCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RouterRoleCount namespace LeaderRoleCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * leaderRoleCount); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t leaderRoleCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace LeaderRoleCount namespace AttachAttemptCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * attachAttemptCount); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t attachAttemptCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AttachAttemptCount namespace PartitionIdChangeCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * partitionIdChangeCount); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t partitionIdChangeCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace PartitionIdChangeCount namespace BetterPartitionAttachAttemptCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * betterPartitionAttachAttemptCount); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t betterPartitionAttachAttemptCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace BetterPartitionAttachAttemptCount namespace ParentChangeCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * parentChangeCount); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t parentChangeCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ParentChangeCount namespace TxTotalCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txTotalCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txTotalCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxTotalCount namespace TxUnicastCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txUnicastCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txUnicastCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxUnicastCount namespace TxBroadcastCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txBroadcastCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txBroadcastCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxBroadcastCount namespace TxAckRequestedCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txAckRequestedCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txAckRequestedCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxAckRequestedCount namespace TxAckedCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txAckedCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txAckedCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxAckedCount namespace TxNoAckRequestedCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txNoAckRequestedCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txNoAckRequestedCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxNoAckRequestedCount namespace TxDataCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txDataCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txDataCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxDataCount namespace TxDataPollCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txDataPollCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txDataPollCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxDataPollCount namespace TxBeaconCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txBeaconCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txBeaconCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxBeaconCount namespace TxBeaconRequestCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txBeaconRequestCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txBeaconRequestCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxBeaconRequestCount namespace TxOtherCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txOtherCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txOtherCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxOtherCount namespace TxRetryCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txRetryCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txRetryCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxRetryCount namespace TxDirectMaxRetryExpiryCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txDirectMaxRetryExpiryCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txDirectMaxRetryExpiryCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxDirectMaxRetryExpiryCount namespace TxIndirectMaxRetryExpiryCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txIndirectMaxRetryExpiryCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txIndirectMaxRetryExpiryCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxIndirectMaxRetryExpiryCount namespace TxErrCcaCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txErrCcaCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txErrCcaCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxErrCcaCount namespace TxErrAbortCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txErrAbortCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txErrAbortCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxErrAbortCount namespace TxErrBusyChannelCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * txErrBusyChannelCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t txErrBusyChannelCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TxErrBusyChannelCount namespace RxTotalCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxTotalCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxTotalCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxTotalCount namespace RxUnicastCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxUnicastCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxUnicastCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxUnicastCount namespace RxBroadcastCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxBroadcastCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxBroadcastCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxBroadcastCount namespace RxDataCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxDataCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxDataCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxDataCount namespace RxDataPollCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxDataPollCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxDataPollCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxDataPollCount namespace RxBeaconCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxBeaconCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxBeaconCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxBeaconCount namespace RxBeaconRequestCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxBeaconRequestCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxBeaconRequestCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxBeaconRequestCount namespace RxOtherCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxOtherCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxOtherCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxOtherCount namespace RxAddressFilteredCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxAddressFilteredCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxAddressFilteredCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxAddressFilteredCount namespace RxDestAddrFilteredCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxDestAddrFilteredCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxDestAddrFilteredCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxDestAddrFilteredCount namespace RxDuplicatedCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxDuplicatedCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxDuplicatedCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxDuplicatedCount namespace RxErrNoFrameCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxErrNoFrameCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrNoFrameCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxErrNoFrameCount namespace RxErrUnknownNeighborCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxErrUnknownNeighborCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrUnknownNeighborCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxErrUnknownNeighborCount namespace RxErrInvalidSrcAddrCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxErrInvalidSrcAddrCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrInvalidSrcAddrCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxErrInvalidSrcAddrCount namespace RxErrSecCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxErrSecCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrSecCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxErrSecCount namespace RxErrFcsCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxErrFcsCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrFcsCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxErrFcsCount namespace RxErrOtherCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * rxErrOtherCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t rxErrOtherCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace RxErrOtherCount namespace ActiveTimestamp { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * activeTimestamp); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t activeTimestamp); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace ActiveTimestamp namespace PendingTimestamp { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * pendingTimestamp); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t pendingTimestamp); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace PendingTimestamp namespace Delay { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * delay); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t delay); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace Delay +namespace ChannelMask { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace ChannelMask + } // namespace Attributes } // namespace ThreadNetworkDiagnostics namespace WiFiNetworkDiagnostics { namespace Attributes { +namespace Bssid { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace Bssid + namespace SecurityType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * securityType); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t securityType); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace SecurityType namespace WiFiVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * wiFiVersion); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t wiFiVersion); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace WiFiVersion namespace ChannelNumber { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * channelNumber); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t channelNumber); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ChannelNumber namespace Rssi { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * rssi); // int8s -EmberAfStatus Set(chip::EndpointId endpoint, int8_t rssi); +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value); // int8s +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value); } // namespace Rssi namespace BeaconLostCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * beaconLostCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t beaconLostCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace BeaconLostCount namespace BeaconRxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * beaconRxCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t beaconRxCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace BeaconRxCount namespace PacketMulticastRxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * packetMulticastRxCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t packetMulticastRxCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace PacketMulticastRxCount namespace PacketMulticastTxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * packetMulticastTxCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t packetMulticastTxCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace PacketMulticastTxCount namespace PacketUnicastRxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * packetUnicastRxCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t packetUnicastRxCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace PacketUnicastRxCount namespace PacketUnicastTxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * packetUnicastTxCount); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t packetUnicastTxCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace PacketUnicastTxCount namespace CurrentMaxRate { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * currentMaxRate); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t currentMaxRate); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace CurrentMaxRate namespace OverrunCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * overrunCount); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t overrunCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace OverrunCount } // namespace Attributes @@ -1343,48 +1473,48 @@ namespace EthernetNetworkDiagnostics { namespace Attributes { namespace PHYRate { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * PHYRate); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t PHYRate); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace PHYRate namespace FullDuplex { -EmberAfStatus Get(chip::EndpointId endpoint, bool * fullDuplex); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool fullDuplex); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace FullDuplex namespace PacketRxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * packetRxCount); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t packetRxCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace PacketRxCount namespace PacketTxCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * packetTxCount); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t packetTxCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace PacketTxCount namespace TxErrCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * txErrCount); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t txErrCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace TxErrCount namespace CollisionCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * collisionCount); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t collisionCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace CollisionCount namespace OverrunCount { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * overrunCount); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t overrunCount); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace OverrunCount namespace CarrierDetect { -EmberAfStatus Get(chip::EndpointId endpoint, bool * carrierDetect); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool carrierDetect); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace CarrierDetect namespace TimeSinceReset { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * timeSinceReset); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t timeSinceReset); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace TimeSinceReset } // namespace Attributes @@ -1393,24 +1523,74 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t timeSinceReset); namespace BridgedDeviceBasic { namespace Attributes { +namespace VendorName { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace VendorName + namespace VendorID { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * vendorID); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t vendorID); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace VendorID +namespace ProductName { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace ProductName + +namespace UserLabel { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace UserLabel + namespace HardwareVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * hardwareVersion); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t hardwareVersion); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace HardwareVersion +namespace HardwareVersionString { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace HardwareVersionString + namespace SoftwareVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * softwareVersion); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t softwareVersion); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace SoftwareVersion +namespace SoftwareVersionString { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace SoftwareVersionString + +namespace ManufacturingDate { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace ManufacturingDate + +namespace PartNumber { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace PartNumber + +namespace ProductURL { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace ProductURL + +namespace ProductLabel { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace ProductLabel + +namespace SerialNumber { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace SerialNumber + namespace Reachable { -EmberAfStatus Get(chip::EndpointId endpoint, bool * reachable); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool reachable); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace Reachable } // namespace Attributes @@ -1420,18 +1600,18 @@ namespace Switch { namespace Attributes { namespace NumberOfPositions { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numberOfPositions); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numberOfPositions); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace NumberOfPositions namespace CurrentPosition { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentPosition); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentPosition); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CurrentPosition namespace MultiPressMax { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * multiPressMax); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t multiPressMax); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MultiPressMax } // namespace Attributes @@ -1441,13 +1621,13 @@ namespace OperationalCredentials { namespace Attributes { namespace SupportedFabrics { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * supportedFabrics); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t supportedFabrics); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace SupportedFabrics namespace CommissionedFabrics { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * commissionedFabrics); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t commissionedFabrics); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CommissionedFabrics } // namespace Attributes @@ -1463,8 +1643,8 @@ namespace BooleanState { namespace Attributes { namespace StateValue { -EmberAfStatus Get(chip::EndpointId endpoint, bool * stateValue); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool stateValue); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace StateValue } // namespace Attributes @@ -1474,28 +1654,28 @@ namespace ShadeConfiguration { namespace Attributes { namespace PhysicalClosedLimit { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * physicalClosedLimit); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t physicalClosedLimit); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace PhysicalClosedLimit namespace MotorStepSize { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * motorStepSize); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t motorStepSize); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MotorStepSize namespace Status { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * status); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t status); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Status namespace ClosedLimit { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * closedLimit); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t closedLimit); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClosedLimit namespace Mode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * mode); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t mode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Mode } // namespace Attributes @@ -1505,213 +1685,218 @@ namespace DoorLock { namespace Attributes { namespace LockState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * lockState); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lockState); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace LockState namespace LockType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * lockType); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lockType); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace LockType namespace ActuatorEnabled { -EmberAfStatus Get(chip::EndpointId endpoint, bool * actuatorEnabled); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool actuatorEnabled); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace ActuatorEnabled namespace DoorState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * doorState); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t doorState); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace DoorState namespace DoorOpenEvents { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * doorOpenEvents); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t doorOpenEvents); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace DoorOpenEvents namespace DoorClosedEvents { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * doorClosedEvents); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t doorClosedEvents); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace DoorClosedEvents namespace OpenPeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * openPeriod); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t openPeriod); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace OpenPeriod namespace NumLockRecordsSupported { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * numLockRecordsSupported); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t numLockRecordsSupported); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace NumLockRecordsSupported namespace NumTotalUsersSupported { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * numTotalUsersSupported); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t numTotalUsersSupported); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace NumTotalUsersSupported namespace NumPinUsersSupported { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * numPinUsersSupported); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t numPinUsersSupported); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace NumPinUsersSupported namespace NumRfidUsersSupported { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * numRfidUsersSupported); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t numRfidUsersSupported); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace NumRfidUsersSupported namespace NumWeekdaySchedulesSupportedPerUser { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numWeekdaySchedulesSupportedPerUser); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numWeekdaySchedulesSupportedPerUser); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace NumWeekdaySchedulesSupportedPerUser namespace NumYeardaySchedulesSupportedPerUser { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numYeardaySchedulesSupportedPerUser); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numYeardaySchedulesSupportedPerUser); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace NumYeardaySchedulesSupportedPerUser namespace NumHolidaySchedulesSupportedPerUser { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numHolidaySchedulesSupportedPerUser); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numHolidaySchedulesSupportedPerUser); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace NumHolidaySchedulesSupportedPerUser namespace MaxPinLength { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * maxPinLength); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t maxPinLength); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MaxPinLength namespace MinPinLength { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * minPinLength); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t minPinLength); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MinPinLength namespace MaxRfidCodeLength { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * maxRfidCodeLength); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t maxRfidCodeLength); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MaxRfidCodeLength namespace MinRfidCodeLength { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * minRfidCodeLength); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t minRfidCodeLength); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MinRfidCodeLength namespace EnableLogging { -EmberAfStatus Get(chip::EndpointId endpoint, bool * enableLogging); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool enableLogging); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace EnableLogging +namespace Language { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace Language + namespace LedSettings { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * ledSettings); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t ledSettings); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace LedSettings namespace AutoRelockTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * autoRelockTime); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t autoRelockTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace AutoRelockTime namespace SoundVolume { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * soundVolume); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t soundVolume); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace SoundVolume namespace OperatingMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * operatingMode); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t operatingMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace OperatingMode namespace SupportedOperatingModes { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * supportedOperatingModes); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t supportedOperatingModes); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace SupportedOperatingModes namespace DefaultConfigurationRegister { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * defaultConfigurationRegister); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t defaultConfigurationRegister); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace DefaultConfigurationRegister namespace EnableLocalProgramming { -EmberAfStatus Get(chip::EndpointId endpoint, bool * enableLocalProgramming); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool enableLocalProgramming); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace EnableLocalProgramming namespace EnableOneTouchLocking { -EmberAfStatus Get(chip::EndpointId endpoint, bool * enableOneTouchLocking); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool enableOneTouchLocking); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace EnableOneTouchLocking namespace EnableInsideStatusLed { -EmberAfStatus Get(chip::EndpointId endpoint, bool * enableInsideStatusLed); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool enableInsideStatusLed); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace EnableInsideStatusLed namespace EnablePrivacyModeButton { -EmberAfStatus Get(chip::EndpointId endpoint, bool * enablePrivacyModeButton); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool enablePrivacyModeButton); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace EnablePrivacyModeButton namespace WrongCodeEntryLimit { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * wrongCodeEntryLimit); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t wrongCodeEntryLimit); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace WrongCodeEntryLimit namespace UserCodeTemporaryDisableTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * userCodeTemporaryDisableTime); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t userCodeTemporaryDisableTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace UserCodeTemporaryDisableTime namespace SendPinOverTheAir { -EmberAfStatus Get(chip::EndpointId endpoint, bool * sendPinOverTheAir); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool sendPinOverTheAir); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace SendPinOverTheAir namespace RequirePinForRfOperation { -EmberAfStatus Get(chip::EndpointId endpoint, bool * requirePinForRfOperation); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool requirePinForRfOperation); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace RequirePinForRfOperation namespace ZigbeeSecurityLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * zigbeeSecurityLevel); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t zigbeeSecurityLevel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ZigbeeSecurityLevel namespace AlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * alarmMask); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t alarmMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AlarmMask namespace KeypadOperationEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * keypadOperationEventMask); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t keypadOperationEventMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace KeypadOperationEventMask namespace RfOperationEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rfOperationEventMask); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rfOperationEventMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RfOperationEventMask namespace ManualOperationEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * manualOperationEventMask); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t manualOperationEventMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ManualOperationEventMask namespace RfidOperationEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rfidOperationEventMask); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rfidOperationEventMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RfidOperationEventMask namespace KeypadProgrammingEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * keypadProgrammingEventMask); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t keypadProgrammingEventMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace KeypadProgrammingEventMask namespace RfProgrammingEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rfProgrammingEventMask); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rfProgrammingEventMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RfProgrammingEventMask namespace RfidProgrammingEventMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rfidProgrammingEventMask); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rfidProgrammingEventMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RfidProgrammingEventMask } // namespace Attributes @@ -1721,128 +1906,138 @@ namespace WindowCovering { namespace Attributes { namespace Type { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * type); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t type); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Type namespace PhysicalClosedLimitLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * physicalClosedLimitLift); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t physicalClosedLimitLift); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace PhysicalClosedLimitLift namespace PhysicalClosedLimitTilt { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * physicalClosedLimitTilt); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t physicalClosedLimitTilt); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace PhysicalClosedLimitTilt namespace CurrentPositionLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentPositionLift); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentPositionLift); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace CurrentPositionLift namespace CurrentPositionTilt { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentPositionTilt); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentPositionTilt); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace CurrentPositionTilt namespace NumberOfActuationsLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * numberOfActuationsLift); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t numberOfActuationsLift); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace NumberOfActuationsLift namespace NumberOfActuationsTilt { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * numberOfActuationsTilt); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t numberOfActuationsTilt); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace NumberOfActuationsTilt namespace ConfigStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * configStatus); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t configStatus); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ConfigStatus namespace CurrentPositionLiftPercentage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentPositionLiftPercentage); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentPositionLiftPercentage); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CurrentPositionLiftPercentage namespace CurrentPositionTiltPercentage { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentPositionTiltPercentage); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentPositionTiltPercentage); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CurrentPositionTiltPercentage namespace OperationalStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * operationalStatus); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t operationalStatus); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace OperationalStatus namespace TargetPositionLiftPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * targetPositionLiftPercent100ths); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t targetPositionLiftPercent100ths); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace TargetPositionLiftPercent100ths namespace TargetPositionTiltPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * targetPositionTiltPercent100ths); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t targetPositionTiltPercent100ths); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace TargetPositionTiltPercent100ths namespace EndProductType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * endProductType); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t endProductType); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace EndProductType namespace CurrentPositionLiftPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentPositionLiftPercent100ths); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentPositionLiftPercent100ths); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace CurrentPositionLiftPercent100ths namespace CurrentPositionTiltPercent100ths { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentPositionTiltPercent100ths); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentPositionTiltPercent100ths); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace CurrentPositionTiltPercent100ths namespace InstalledOpenLimitLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * installedOpenLimitLift); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t installedOpenLimitLift); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace InstalledOpenLimitLift namespace InstalledClosedLimitLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * installedClosedLimitLift); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t installedClosedLimitLift); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace InstalledClosedLimitLift namespace InstalledOpenLimitTilt { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * installedOpenLimitTilt); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t installedOpenLimitTilt); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace InstalledOpenLimitTilt namespace InstalledClosedLimitTilt { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * installedClosedLimitTilt); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t installedClosedLimitTilt); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace InstalledClosedLimitTilt namespace VelocityLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * velocityLift); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t velocityLift); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace VelocityLift namespace AccelerationTimeLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * accelerationTimeLift); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t accelerationTimeLift); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AccelerationTimeLift namespace DecelerationTimeLift { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * decelerationTimeLift); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t decelerationTimeLift); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace DecelerationTimeLift namespace Mode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * mode); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t mode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Mode +namespace IntermediateSetpointsLift { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace IntermediateSetpointsLift + +namespace IntermediateSetpointsTilt { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace IntermediateSetpointsTilt + namespace SafetyStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * safetyStatus); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t safetyStatus); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace SafetyStatus } // namespace Attributes @@ -1852,53 +2047,53 @@ namespace BarrierControl { namespace Attributes { namespace BarrierMovingState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * barrierMovingState); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t barrierMovingState); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BarrierMovingState namespace BarrierSafetyStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierSafetyStatus); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierSafetyStatus); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace BarrierSafetyStatus namespace BarrierCapabilities { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * barrierCapabilities); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t barrierCapabilities); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BarrierCapabilities namespace BarrierOpenEvents { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierOpenEvents); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierOpenEvents); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace BarrierOpenEvents namespace BarrierCloseEvents { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierCloseEvents); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierCloseEvents); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace BarrierCloseEvents namespace BarrierCommandOpenEvents { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierCommandOpenEvents); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierCommandOpenEvents); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace BarrierCommandOpenEvents namespace BarrierCommandCloseEvents { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierCommandCloseEvents); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierCommandCloseEvents); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace BarrierCommandCloseEvents namespace BarrierOpenPeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierOpenPeriod); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierOpenPeriod); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace BarrierOpenPeriod namespace BarrierClosePeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * barrierClosePeriod); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t barrierClosePeriod); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace BarrierClosePeriod namespace BarrierPosition { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * barrierPosition); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t barrierPosition); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BarrierPosition } // namespace Attributes @@ -1908,113 +2103,113 @@ namespace PumpConfigurationAndControl { namespace Attributes { namespace MaxPressure { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxPressure); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxPressure); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MaxPressure namespace MaxSpeed { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxSpeed); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxSpeed); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MaxSpeed namespace MaxFlow { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxFlow); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxFlow); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MaxFlow namespace MinConstPressure { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minConstPressure); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minConstPressure); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MinConstPressure namespace MaxConstPressure { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxConstPressure); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxConstPressure); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MaxConstPressure namespace MinCompPressure { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minCompPressure); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minCompPressure); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MinCompPressure namespace MaxCompPressure { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxCompPressure); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxCompPressure); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MaxCompPressure namespace MinConstSpeed { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * minConstSpeed); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minConstSpeed); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MinConstSpeed namespace MaxConstSpeed { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxConstSpeed); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxConstSpeed); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MaxConstSpeed namespace MinConstFlow { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * minConstFlow); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minConstFlow); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MinConstFlow namespace MaxConstFlow { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxConstFlow); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxConstFlow); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MaxConstFlow namespace MinConstTemp { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minConstTemp); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minConstTemp); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MinConstTemp namespace MaxConstTemp { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxConstTemp); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxConstTemp); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MaxConstTemp namespace PumpStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * pumpStatus); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t pumpStatus); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace PumpStatus namespace EffectiveOperationMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * effectiveOperationMode); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t effectiveOperationMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace EffectiveOperationMode namespace EffectiveControlMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * effectiveControlMode); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t effectiveControlMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace EffectiveControlMode namespace Capacity { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * capacity); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t capacity); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace Capacity namespace Speed { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * speed); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t speed); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Speed namespace LifetimeEnergyConsumed { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * lifetimeEnergyConsumed); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t lifetimeEnergyConsumed); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace LifetimeEnergyConsumed namespace OperationMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * operationMode); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t operationMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace OperationMode namespace ControlMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * controlMode); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t controlMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ControlMode namespace AlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * alarmMask); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t alarmMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AlarmMask } // namespace Attributes @@ -2024,218 +2219,218 @@ namespace Thermostat { namespace Attributes { namespace LocalTemperature { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * localTemperature); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t localTemperature); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace LocalTemperature namespace OutdoorTemperature { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * outdoorTemperature); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t outdoorTemperature); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace OutdoorTemperature namespace Occupancy { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * occupancy); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t occupancy); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Occupancy namespace AbsMinHeatSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * absMinHeatSetpointLimit); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t absMinHeatSetpointLimit); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace AbsMinHeatSetpointLimit namespace AbsMaxHeatSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * absMaxHeatSetpointLimit); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t absMaxHeatSetpointLimit); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace AbsMaxHeatSetpointLimit namespace AbsMinCoolSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * absMinCoolSetpointLimit); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t absMinCoolSetpointLimit); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace AbsMinCoolSetpointLimit namespace AbsMaxCoolSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * absMaxCoolSetpointLimit); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t absMaxCoolSetpointLimit); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace AbsMaxCoolSetpointLimit namespace PiCoolingDemand { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * piCoolingDemand); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t piCoolingDemand); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace PiCoolingDemand namespace PiHeatingDemand { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * piHeatingDemand); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t piHeatingDemand); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace PiHeatingDemand namespace HvacSystemTypeConfiguration { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * hvacSystemTypeConfiguration); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t hvacSystemTypeConfiguration); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace HvacSystemTypeConfiguration namespace LocalTemperatureCalibration { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * localTemperatureCalibration); // int8s -EmberAfStatus Set(chip::EndpointId endpoint, int8_t localTemperatureCalibration); +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value); // int8s +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value); } // namespace LocalTemperatureCalibration namespace OccupiedCoolingSetpoint { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * occupiedCoolingSetpoint); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t occupiedCoolingSetpoint); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace OccupiedCoolingSetpoint namespace OccupiedHeatingSetpoint { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * occupiedHeatingSetpoint); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t occupiedHeatingSetpoint); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace OccupiedHeatingSetpoint namespace UnoccupiedCoolingSetpoint { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * unoccupiedCoolingSetpoint); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t unoccupiedCoolingSetpoint); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace UnoccupiedCoolingSetpoint namespace UnoccupiedHeatingSetpoint { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * unoccupiedHeatingSetpoint); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t unoccupiedHeatingSetpoint); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace UnoccupiedHeatingSetpoint namespace MinHeatSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minHeatSetpointLimit); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minHeatSetpointLimit); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MinHeatSetpointLimit namespace MaxHeatSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxHeatSetpointLimit); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxHeatSetpointLimit); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MaxHeatSetpointLimit namespace MinCoolSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minCoolSetpointLimit); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minCoolSetpointLimit); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MinCoolSetpointLimit namespace MaxCoolSetpointLimit { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxCoolSetpointLimit); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxCoolSetpointLimit); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MaxCoolSetpointLimit namespace MinSetpointDeadBand { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * minSetpointDeadBand); // int8s -EmberAfStatus Set(chip::EndpointId endpoint, int8_t minSetpointDeadBand); +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value); // int8s +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value); } // namespace MinSetpointDeadBand namespace RemoteSensing { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * remoteSensing); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t remoteSensing); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace RemoteSensing namespace ControlSequenceOfOperation { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * controlSequenceOfOperation); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t controlSequenceOfOperation); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ControlSequenceOfOperation namespace SystemMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * systemMode); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t systemMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace SystemMode namespace AlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * alarmMask); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t alarmMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace AlarmMask namespace ThermostatRunningMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * thermostatRunningMode); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t thermostatRunningMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ThermostatRunningMode namespace StartOfWeek { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * startOfWeek); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t startOfWeek); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace StartOfWeek namespace NumberOfWeeklyTransitions { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numberOfWeeklyTransitions); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numberOfWeeklyTransitions); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace NumberOfWeeklyTransitions namespace NumberOfDailyTransitions { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numberOfDailyTransitions); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numberOfDailyTransitions); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace NumberOfDailyTransitions namespace TemperatureSetpointHold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * temperatureSetpointHold); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t temperatureSetpointHold); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace TemperatureSetpointHold namespace TemperatureSetpointHoldDuration { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * temperatureSetpointHoldDuration); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t temperatureSetpointHoldDuration); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace TemperatureSetpointHoldDuration namespace ThermostatProgrammingOperationMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * thermostatProgrammingOperationMode); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t thermostatProgrammingOperationMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ThermostatProgrammingOperationMode namespace HvacRelayState { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * hvacRelayState); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t hvacRelayState); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace HvacRelayState namespace SetpointChangeSource { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * setpointChangeSource); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t setpointChangeSource); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace SetpointChangeSource namespace SetpointChangeAmount { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * setpointChangeAmount); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t setpointChangeAmount); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace SetpointChangeAmount namespace SetpointChangeSourceTimestamp { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * setpointChangeSourceTimestamp); // epoch_s -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t setpointChangeSourceTimestamp); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // epoch_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace SetpointChangeSourceTimestamp namespace AcType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * acType); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t acType); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace AcType namespace AcCapacity { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acCapacity); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acCapacity); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AcCapacity namespace AcRefrigerantType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * acRefrigerantType); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t acRefrigerantType); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace AcRefrigerantType namespace AcCompressor { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * acCompressor); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t acCompressor); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace AcCompressor namespace AcErrorCode { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * acErrorCode); // bitmap32 -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t acErrorCode); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace AcErrorCode namespace AcLouverPosition { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * acLouverPosition); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t acLouverPosition); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace AcLouverPosition namespace AcCoilTemperature { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * acCoilTemperature); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t acCoilTemperature); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace AcCoilTemperature namespace AcCapacityFormat { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * acCapacityFormat); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t acCapacityFormat); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace AcCapacityFormat } // namespace Attributes @@ -2245,13 +2440,13 @@ namespace FanControl { namespace Attributes { namespace FanMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * fanMode); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t fanMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace FanMode namespace FanModeSequence { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * fanModeSequence); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t fanModeSequence); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace FanModeSequence } // namespace Attributes @@ -2261,43 +2456,43 @@ namespace DehumidificationControl { namespace Attributes { namespace RelativeHumidity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * relativeHumidity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t relativeHumidity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace RelativeHumidity namespace DehumidificationCooling { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * dehumidificationCooling); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dehumidificationCooling); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace DehumidificationCooling namespace RhDehumidificationSetpoint { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * rhDehumidificationSetpoint); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t rhDehumidificationSetpoint); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace RhDehumidificationSetpoint namespace RelativeHumidityMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * relativeHumidityMode); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t relativeHumidityMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace RelativeHumidityMode namespace DehumidificationLockout { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * dehumidificationLockout); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dehumidificationLockout); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace DehumidificationLockout namespace DehumidificationHysteresis { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * dehumidificationHysteresis); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dehumidificationHysteresis); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace DehumidificationHysteresis namespace DehumidificationMaxCool { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * dehumidificationMaxCool); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t dehumidificationMaxCool); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace DehumidificationMaxCool namespace RelativeHumidityDisplay { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * relativeHumidityDisplay); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t relativeHumidityDisplay); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace RelativeHumidityDisplay } // namespace Attributes @@ -2307,18 +2502,18 @@ namespace ThermostatUserInterfaceConfiguration { namespace Attributes { namespace TemperatureDisplayMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * temperatureDisplayMode); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t temperatureDisplayMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace TemperatureDisplayMode namespace KeypadLockout { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * keypadLockout); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t keypadLockout); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace KeypadLockout namespace ScheduleProgrammingVisibility { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * scheduleProgrammingVisibility); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t scheduleProgrammingVisibility); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ScheduleProgrammingVisibility } // namespace Attributes @@ -2328,258 +2523,263 @@ namespace ColorControl { namespace Attributes { namespace CurrentHue { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentHue); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentHue); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CurrentHue namespace CurrentSaturation { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentSaturation); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentSaturation); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CurrentSaturation namespace RemainingTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * remainingTime); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t remainingTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RemainingTime namespace CurrentX { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentX); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentX); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace CurrentX namespace CurrentY { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * currentY); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t currentY); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace CurrentY namespace DriftCompensation { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * driftCompensation); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t driftCompensation); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace DriftCompensation +namespace CompensationText { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace CompensationText + namespace ColorTemperature { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorTemperature); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorTemperature); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ColorTemperature namespace ColorMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorMode); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ColorMode namespace ColorControlOptions { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorControlOptions); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorControlOptions); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ColorControlOptions namespace NumberOfPrimaries { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numberOfPrimaries); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numberOfPrimaries); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace NumberOfPrimaries namespace Primary1X { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary1X); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary1X); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Primary1X namespace Primary1Y { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary1Y); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary1Y); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Primary1Y namespace Primary1Intensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * primary1Intensity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t primary1Intensity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Primary1Intensity namespace Primary2X { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary2X); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary2X); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Primary2X namespace Primary2Y { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary2Y); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary2Y); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Primary2Y namespace Primary2Intensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * primary2Intensity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t primary2Intensity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Primary2Intensity namespace Primary3X { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary3X); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary3X); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Primary3X namespace Primary3Y { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary3Y); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary3Y); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Primary3Y namespace Primary3Intensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * primary3Intensity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t primary3Intensity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Primary3Intensity namespace Primary4X { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary4X); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary4X); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Primary4X namespace Primary4Y { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary4Y); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary4Y); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Primary4Y namespace Primary4Intensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * primary4Intensity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t primary4Intensity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Primary4Intensity namespace Primary5X { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary5X); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary5X); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Primary5X namespace Primary5Y { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary5Y); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary5Y); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Primary5Y namespace Primary5Intensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * primary5Intensity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t primary5Intensity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Primary5Intensity namespace Primary6X { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary6X); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary6X); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Primary6X namespace Primary6Y { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * primary6Y); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t primary6Y); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Primary6Y namespace Primary6Intensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * primary6Intensity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t primary6Intensity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Primary6Intensity namespace WhitePointX { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * whitePointX); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t whitePointX); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace WhitePointX namespace WhitePointY { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * whitePointY); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t whitePointY); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace WhitePointY namespace ColorPointRX { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorPointRX); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorPointRX); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ColorPointRX namespace ColorPointRY { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorPointRY); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorPointRY); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ColorPointRY namespace ColorPointRIntensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorPointRIntensity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorPointRIntensity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ColorPointRIntensity namespace ColorPointGX { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorPointGX); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorPointGX); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ColorPointGX namespace ColorPointGY { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorPointGY); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorPointGY); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ColorPointGY namespace ColorPointGIntensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorPointGIntensity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorPointGIntensity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ColorPointGIntensity namespace ColorPointBX { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorPointBX); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorPointBX); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ColorPointBX namespace ColorPointBY { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorPointBY); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorPointBY); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ColorPointBY namespace ColorPointBIntensity { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorPointBIntensity); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorPointBIntensity); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ColorPointBIntensity namespace EnhancedCurrentHue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * enhancedCurrentHue); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t enhancedCurrentHue); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace EnhancedCurrentHue namespace EnhancedColorMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * enhancedColorMode); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t enhancedColorMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace EnhancedColorMode namespace ColorLoopActive { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorLoopActive); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorLoopActive); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ColorLoopActive namespace ColorLoopDirection { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * colorLoopDirection); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t colorLoopDirection); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ColorLoopDirection namespace ColorLoopTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorLoopTime); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorLoopTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ColorLoopTime namespace ColorLoopStartEnhancedHue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorLoopStartEnhancedHue); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorLoopStartEnhancedHue); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ColorLoopStartEnhancedHue namespace ColorLoopStoredEnhancedHue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorLoopStoredEnhancedHue); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorLoopStoredEnhancedHue); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ColorLoopStoredEnhancedHue namespace ColorCapabilities { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorCapabilities); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorCapabilities); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ColorCapabilities namespace ColorTempPhysicalMin { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorTempPhysicalMin); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorTempPhysicalMin); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ColorTempPhysicalMin namespace ColorTempPhysicalMax { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * colorTempPhysicalMax); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t colorTempPhysicalMax); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ColorTempPhysicalMax namespace CoupleColorTempToLevelMinMireds { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * coupleColorTempToLevelMinMireds); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t coupleColorTempToLevelMinMireds); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace CoupleColorTempToLevelMinMireds namespace StartUpColorTemperatureMireds { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * startUpColorTemperatureMireds); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t startUpColorTemperatureMireds); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace StartUpColorTemperatureMireds } // namespace Attributes @@ -2589,58 +2789,68 @@ namespace BallastConfiguration { namespace Attributes { namespace PhysicalMinLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * physicalMinLevel); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t physicalMinLevel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace PhysicalMinLevel namespace PhysicalMaxLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * physicalMaxLevel); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t physicalMaxLevel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace PhysicalMaxLevel namespace BallastStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * ballastStatus); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t ballastStatus); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BallastStatus namespace MinLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * minLevel); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t minLevel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MinLevel namespace MaxLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * maxLevel); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t maxLevel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace MaxLevel namespace PowerOnLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * powerOnLevel); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t powerOnLevel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace PowerOnLevel namespace PowerOnFadeTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * powerOnFadeTime); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t powerOnFadeTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace PowerOnFadeTime namespace IntrinsicBallastFactor { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * intrinsicBallastFactor); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t intrinsicBallastFactor); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace IntrinsicBallastFactor namespace BallastFactorAdjustment { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * ballastFactorAdjustment); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t ballastFactorAdjustment); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace BallastFactorAdjustment namespace LampQuality { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * lampQuality); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lampQuality); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace LampQuality +namespace LampType { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace LampType + +namespace LampManufacturer { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace LampManufacturer + namespace LampAlarmMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * lampAlarmMode); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lampAlarmMode); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace LampAlarmMode } // namespace Attributes @@ -2650,28 +2860,28 @@ namespace IlluminanceMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * measuredValue); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * minMeasuredValue); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxMeasuredValue); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * tolerance); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Tolerance namespace LightSensorType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * lightSensorType); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t lightSensorType); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace LightSensorType } // namespace Attributes @@ -2681,23 +2891,23 @@ namespace TemperatureMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredValue); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minMeasuredValue); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxMeasuredValue); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * tolerance); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Tolerance } // namespace Attributes @@ -2707,48 +2917,48 @@ namespace PressureMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredValue); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minMeasuredValue); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxMeasuredValue); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * tolerance); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Tolerance namespace ScaledValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * scaledValue); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t scaledValue); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ScaledValue namespace MinScaledValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minScaledValue); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minScaledValue); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MinScaledValue namespace MaxScaledValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxScaledValue); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxScaledValue); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MaxScaledValue namespace ScaledTolerance { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * scaledTolerance); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t scaledTolerance); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ScaledTolerance namespace Scale { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * scale); // int8s -EmberAfStatus Set(chip::EndpointId endpoint, int8_t scale); +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value); // int8s +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value); } // namespace Scale } // namespace Attributes @@ -2758,23 +2968,23 @@ namespace FlowMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredValue); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * minMeasuredValue); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * maxMeasuredValue); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * tolerance); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Tolerance } // namespace Attributes @@ -2784,23 +2994,23 @@ namespace RelativeHumidityMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * measuredValue); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * minMeasuredValue); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxMeasuredValue); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * tolerance); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Tolerance } // namespace Attributes @@ -2810,63 +3020,63 @@ namespace OccupancySensing { namespace Attributes { namespace Occupancy { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * occupancy); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t occupancy); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Occupancy namespace OccupancySensorType { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * occupancySensorType); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t occupancySensorType); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace OccupancySensorType namespace OccupancySensorTypeBitmap { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * occupancySensorTypeBitmap); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t occupancySensorTypeBitmap); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace OccupancySensorTypeBitmap namespace PirOccupiedToUnoccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * pirOccupiedToUnoccupiedDelay); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t pirOccupiedToUnoccupiedDelay); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace PirOccupiedToUnoccupiedDelay namespace PirUnoccupiedToOccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * pirUnoccupiedToOccupiedDelay); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t pirUnoccupiedToOccupiedDelay); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace PirUnoccupiedToOccupiedDelay namespace PirUnoccupiedToOccupiedThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * pirUnoccupiedToOccupiedThreshold); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t pirUnoccupiedToOccupiedThreshold); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace PirUnoccupiedToOccupiedThreshold namespace UltrasonicOccupiedToUnoccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * ultrasonicOccupiedToUnoccupiedDelay); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t ultrasonicOccupiedToUnoccupiedDelay); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace UltrasonicOccupiedToUnoccupiedDelay namespace UltrasonicUnoccupiedToOccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * ultrasonicUnoccupiedToOccupiedDelay); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t ultrasonicUnoccupiedToOccupiedDelay); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace UltrasonicUnoccupiedToOccupiedDelay namespace UltrasonicUnoccupiedToOccupiedThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * ultrasonicUnoccupiedToOccupiedThreshold); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t ultrasonicUnoccupiedToOccupiedThreshold); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace UltrasonicUnoccupiedToOccupiedThreshold namespace PhysicalContactOccupiedToUnoccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * physicalContactOccupiedToUnoccupiedDelay); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t physicalContactOccupiedToUnoccupiedDelay); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace PhysicalContactOccupiedToUnoccupiedDelay namespace PhysicalContactUnoccupiedToOccupiedDelay { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * physicalContactUnoccupiedToOccupiedDelay); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t physicalContactUnoccupiedToOccupiedDelay); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace PhysicalContactUnoccupiedToOccupiedDelay namespace PhysicalContactUnoccupiedToOccupiedThreshold { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * physicalContactUnoccupiedToOccupiedThreshold); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t physicalContactUnoccupiedToOccupiedThreshold); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace PhysicalContactUnoccupiedToOccupiedThreshold } // namespace Attributes @@ -2876,23 +3086,23 @@ namespace CarbonMonoxideConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -2902,23 +3112,23 @@ namespace CarbonDioxideConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -2928,23 +3138,23 @@ namespace EthyleneConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -2954,23 +3164,23 @@ namespace EthyleneOxideConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -2980,23 +3190,23 @@ namespace HydrogenConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3006,23 +3216,23 @@ namespace HydrogenSulphideConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3032,23 +3242,23 @@ namespace NitricOxideConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3058,23 +3268,23 @@ namespace NitrogenDioxideConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3084,23 +3294,23 @@ namespace OxygenConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3110,23 +3320,23 @@ namespace OzoneConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3136,23 +3346,23 @@ namespace SulfurDioxideConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3162,23 +3372,23 @@ namespace DissolvedOxygenConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3188,23 +3398,23 @@ namespace BromateConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3214,23 +3424,23 @@ namespace ChloraminesConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3240,23 +3450,23 @@ namespace ChlorineConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3266,23 +3476,23 @@ namespace FecalColiformAndEColiConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3292,23 +3502,23 @@ namespace FluorideConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3318,23 +3528,23 @@ namespace HaloaceticAcidsConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3344,23 +3554,23 @@ namespace TotalTrihalomethanesConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3370,23 +3580,23 @@ namespace TotalColiformBacteriaConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3396,23 +3606,23 @@ namespace TurbidityConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3422,23 +3632,23 @@ namespace CopperConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3448,23 +3658,23 @@ namespace LeadConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3474,23 +3684,23 @@ namespace ManganeseConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3500,23 +3710,23 @@ namespace SulfateConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3526,23 +3736,23 @@ namespace BromodichloromethaneConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3552,23 +3762,23 @@ namespace BromoformConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3578,23 +3788,23 @@ namespace ChlorodibromomethaneConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3604,23 +3814,23 @@ namespace ChloroformConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3630,23 +3840,23 @@ namespace SodiumConcentrationMeasurement { namespace Attributes { namespace MeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * measuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float measuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MeasuredValue namespace MinMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * minMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float minMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MinMeasuredValue namespace MaxMeasuredValue { -EmberAfStatus Get(chip::EndpointId endpoint, float * maxMeasuredValue); // single -EmberAfStatus Set(chip::EndpointId endpoint, float maxMeasuredValue); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace MaxMeasuredValue namespace Tolerance { -EmberAfStatus Get(chip::EndpointId endpoint, float * tolerance); // single -EmberAfStatus Set(chip::EndpointId endpoint, float tolerance); +EmberAfStatus Get(chip::EndpointId endpoint, float * value); // single +EmberAfStatus Set(chip::EndpointId endpoint, float value); } // namespace Tolerance } // namespace Attributes @@ -3656,38 +3866,38 @@ namespace IasZone { namespace Attributes { namespace ZoneState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * zoneState); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t zoneState); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ZoneState namespace ZoneType { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * zoneType); // enum16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t zoneType); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // enum16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ZoneType namespace ZoneStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * zoneStatus); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t zoneStatus); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ZoneStatus namespace IasCieAddress { -EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * iasCieAddress); // node_id -EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId iasCieAddress); +EmberAfStatus Get(chip::EndpointId endpoint, chip::NodeId * value); // node_id +EmberAfStatus Set(chip::EndpointId endpoint, chip::NodeId value); } // namespace IasCieAddress namespace ZoneId { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * zoneId); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t zoneId); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ZoneId namespace NumberOfZoneSensitivityLevelsSupported { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * numberOfZoneSensitivityLevelsSupported); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t numberOfZoneSensitivityLevelsSupported); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace NumberOfZoneSensitivityLevelsSupported namespace CurrentZoneSensitivityLevel { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentZoneSensitivityLevel); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentZoneSensitivityLevel); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CurrentZoneSensitivityLevel } // namespace Attributes @@ -3697,8 +3907,8 @@ namespace IasWd { namespace Attributes { namespace MaxDuration { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * maxDuration); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxDuration); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MaxDuration } // namespace Attributes @@ -3707,12 +3917,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t maxDuration); namespace WakeOnLan { namespace Attributes { +namespace WakeOnLanMacAddress { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace WakeOnLanMacAddress + } // namespace Attributes } // namespace WakeOnLan namespace TvChannel { namespace Attributes { +namespace TvChannelLineup { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace TvChannelLineup + +namespace CurrentTvChannel { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace CurrentTvChannel + } // namespace Attributes } // namespace TvChannel @@ -3720,8 +3945,8 @@ namespace TargetNavigator { namespace Attributes { namespace CurrentNavigatorTarget { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentNavigatorTarget); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentNavigatorTarget); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CurrentNavigatorTarget } // namespace Attributes @@ -3731,43 +3956,43 @@ namespace MediaPlayback { namespace Attributes { namespace PlaybackState { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * playbackState); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t playbackState); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace PlaybackState namespace StartTime { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * startTime); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t startTime); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace StartTime namespace Duration { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * duration); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t duration); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace Duration namespace PositionUpdatedAt { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * positionUpdatedAt); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t positionUpdatedAt); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace PositionUpdatedAt namespace Position { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * position); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t position); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace Position namespace PlaybackSpeed { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * playbackSpeed); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t playbackSpeed); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace PlaybackSpeed namespace SeekRangeEnd { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * seekRangeEnd); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t seekRangeEnd); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace SeekRangeEnd namespace SeekRangeStart { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * seekRangeStart); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t seekRangeStart); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace SeekRangeStart } // namespace Attributes @@ -3777,8 +4002,8 @@ namespace MediaInput { namespace Attributes { namespace CurrentMediaInput { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentMediaInput); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentMediaInput); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CurrentMediaInput } // namespace Attributes @@ -3794,8 +4019,8 @@ namespace AudioOutput { namespace Attributes { namespace CurrentAudioOutput { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * currentAudioOutput); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t currentAudioOutput); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CurrentAudioOutput } // namespace Attributes @@ -3805,13 +4030,13 @@ namespace ApplicationLauncher { namespace Attributes { namespace CatalogVendorId { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * catalogVendorId); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t catalogVendorId); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CatalogVendorId namespace ApplicationId { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * applicationId); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t applicationId); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ApplicationId } // namespace Attributes @@ -3820,24 +4045,39 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t applicationId); namespace ApplicationBasic { namespace Attributes { +namespace VendorName { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace VendorName + namespace VendorId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * vendorId); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t vendorId); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace VendorId +namespace ApplicationName { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace ApplicationName + namespace ProductId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * productId); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t productId); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ProductId +namespace ApplicationId { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace ApplicationId + namespace CatalogVendorId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * catalogVendorId); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t catalogVendorId); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace CatalogVendorId namespace ApplicationStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * applicationStatus); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t applicationStatus); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace ApplicationStatus } // namespace Attributes @@ -3847,98 +4087,118 @@ namespace TestCluster { namespace Attributes { namespace Boolean { -EmberAfStatus Get(chip::EndpointId endpoint, bool * boolean); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool boolean); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace Boolean namespace Bitmap8 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * bitmap8); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t bitmap8); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Bitmap8 namespace Bitmap16 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * bitmap16); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t bitmap16); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Bitmap16 namespace Bitmap32 { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * bitmap32); // bitmap32 -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t bitmap32); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace Bitmap32 namespace Bitmap64 { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * bitmap64); // bitmap64 -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t bitmap64); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // bitmap64 +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace Bitmap64 namespace Int8u { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * int8u); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t int8u); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Int8u namespace Int16u { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * int16u); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t int16u); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Int16u namespace Int32u { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * int32u); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t int32u); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace Int32u namespace Int64u { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * int64u); // int64u -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t int64u); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // int64u +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace Int64u namespace Int8s { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * int8s); // int8s -EmberAfStatus Set(chip::EndpointId endpoint, int8_t int8s); +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value); // int8s +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value); } // namespace Int8s namespace Int16s { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * int16s); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t int16s); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace Int16s namespace Int32s { -EmberAfStatus Get(chip::EndpointId endpoint, int32_t * int32s); // int32s -EmberAfStatus Set(chip::EndpointId endpoint, int32_t int32s); +EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value); // int32s +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value); } // namespace Int32s namespace Int64s { -EmberAfStatus Get(chip::EndpointId endpoint, int64_t * int64s); // int64s -EmberAfStatus Set(chip::EndpointId endpoint, int64_t int64s); +EmberAfStatus Get(chip::EndpointId endpoint, int64_t * value); // int64s +EmberAfStatus Set(chip::EndpointId endpoint, int64_t value); } // namespace Int64s namespace Enum8 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * enum8); // enum8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t enum8); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // enum8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Enum8 namespace Enum16 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * enum16); // enum16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t enum16); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // enum16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Enum16 +namespace OctetString { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace OctetString + +namespace LongOctetString { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // long_octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace LongOctetString + +namespace CharString { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace CharString + +namespace LongCharString { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // long_char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace LongCharString + namespace EpochUs { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * epochUs); // epoch_us -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t epochUs); +EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // epoch_us +EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); } // namespace EpochUs namespace EpochS { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * epochS); // epoch_s -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t epochS); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // epoch_s +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace EpochS namespace VendorId { -EmberAfStatus Get(chip::EndpointId endpoint, chip::VendorId * vendorId); // vendor_id -EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId vendorId); +EmberAfStatus Get(chip::EndpointId endpoint, chip::VendorId * value); // vendor_id +EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId value); } // namespace VendorId namespace Unsupported { -EmberAfStatus Get(chip::EndpointId endpoint, bool * unsupported); // boolean -EmberAfStatus Set(chip::EndpointId endpoint, bool unsupported); +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace Unsupported } // namespace Attributes @@ -3947,24 +4207,59 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool unsupported); namespace ApplianceIdentification { namespace Attributes { +namespace CompanyName { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace CompanyName + namespace CompanyId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * companyId); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t companyId); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace CompanyId +namespace BrandName { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace BrandName + namespace BrandId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * brandId); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t brandId); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace BrandId +namespace Model { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace Model + +namespace PartNumber { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace PartNumber + +namespace ProductRevision { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace ProductRevision + +namespace SoftwareRevision { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace SoftwareRevision + +namespace ProductTypeName { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace ProductTypeName + namespace ProductTypeId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * productTypeId); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t productTypeId); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ProductTypeId namespace CecedSpecificationVersion { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * cecedSpecificationVersion); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t cecedSpecificationVersion); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace CecedSpecificationVersion } // namespace Attributes @@ -3973,16 +4268,56 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t cecedSpecificationVersion); namespace MeterIdentification { namespace Attributes { +namespace CompanyName { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace CompanyName + namespace MeterTypeId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * meterTypeId); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t meterTypeId); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace MeterTypeId namespace DataQualityId { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dataQualityId); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dataQualityId); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace DataQualityId +namespace CustomerName { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace CustomerName + +namespace Model { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace Model + +namespace PartNumber { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace PartNumber + +namespace ProductRevision { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace ProductRevision + +namespace SoftwareRevision { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); +} // namespace SoftwareRevision + +namespace UtilityName { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace UtilityName + +namespace Pod { +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); +} // namespace Pod + } // namespace Attributes } // namespace MeterIdentification @@ -3990,13 +4325,13 @@ namespace ApplianceStatistics { namespace Attributes { namespace LogMaxSize { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * logMaxSize); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t logMaxSize); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace LogMaxSize namespace LogQueueMaxSize { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * logQueueMaxSize); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t logQueueMaxSize); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace LogQueueMaxSize } // namespace Attributes @@ -4006,643 +4341,643 @@ namespace ElectricalMeasurement { namespace Attributes { namespace MeasurementType { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * measurementType); // bitmap32 -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t measurementType); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace MeasurementType namespace DcVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcVoltage); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace DcVoltage namespace DcVoltageMin { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcVoltageMin); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcVoltageMin); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace DcVoltageMin namespace DcVoltageMax { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcVoltageMax); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcVoltageMax); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace DcVoltageMax namespace DcCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace DcCurrent namespace DcCurrentMin { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcCurrentMin); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcCurrentMin); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace DcCurrentMin namespace DcCurrentMax { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcCurrentMax); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcCurrentMax); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace DcCurrentMax namespace DcPower { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcPower); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcPower); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace DcPower namespace DcPowerMin { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcPowerMin); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcPowerMin); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace DcPowerMin namespace DcPowerMax { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * dcPowerMax); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t dcPowerMax); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace DcPowerMax namespace DcVoltageMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dcVoltageMultiplier); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcVoltageMultiplier); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace DcVoltageMultiplier namespace DcVoltageDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dcVoltageDivisor); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcVoltageDivisor); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace DcVoltageDivisor namespace DcCurrentMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dcCurrentMultiplier); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcCurrentMultiplier); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace DcCurrentMultiplier namespace DcCurrentDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dcCurrentDivisor); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcCurrentDivisor); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace DcCurrentDivisor namespace DcPowerMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dcPowerMultiplier); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcPowerMultiplier); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace DcPowerMultiplier namespace DcPowerDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * dcPowerDivisor); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t dcPowerDivisor); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace DcPowerDivisor namespace AcFrequency { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acFrequency); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequency); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AcFrequency namespace AcFrequencyMin { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acFrequencyMin); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequencyMin); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AcFrequencyMin namespace AcFrequencyMax { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acFrequencyMax); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequencyMax); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AcFrequencyMax namespace NeutralCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * neutralCurrent); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t neutralCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace NeutralCurrent namespace TotalActivePower { -EmberAfStatus Get(chip::EndpointId endpoint, int32_t * totalActivePower); // int32s -EmberAfStatus Set(chip::EndpointId endpoint, int32_t totalActivePower); +EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value); // int32s +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value); } // namespace TotalActivePower namespace TotalReactivePower { -EmberAfStatus Get(chip::EndpointId endpoint, int32_t * totalReactivePower); // int32s -EmberAfStatus Set(chip::EndpointId endpoint, int32_t totalReactivePower); +EmberAfStatus Get(chip::EndpointId endpoint, int32_t * value); // int32s +EmberAfStatus Set(chip::EndpointId endpoint, int32_t value); } // namespace TotalReactivePower namespace TotalApparentPower { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * totalApparentPower); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t totalApparentPower); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace TotalApparentPower namespace Measured1stHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measured1stHarmonicCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured1stHarmonicCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace Measured1stHarmonicCurrent namespace Measured3rdHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measured3rdHarmonicCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured3rdHarmonicCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace Measured3rdHarmonicCurrent namespace Measured5thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measured5thHarmonicCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured5thHarmonicCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace Measured5thHarmonicCurrent namespace Measured7thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measured7thHarmonicCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured7thHarmonicCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace Measured7thHarmonicCurrent namespace Measured9thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measured9thHarmonicCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured9thHarmonicCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace Measured9thHarmonicCurrent namespace Measured11thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measured11thHarmonicCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measured11thHarmonicCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace Measured11thHarmonicCurrent namespace MeasuredPhase1stHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredPhase1stHarmonicCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredPhase1stHarmonicCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MeasuredPhase1stHarmonicCurrent namespace MeasuredPhase3rdHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredPhase3rdHarmonicCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredPhase3rdHarmonicCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MeasuredPhase3rdHarmonicCurrent namespace MeasuredPhase5thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredPhase5thHarmonicCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredPhase5thHarmonicCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MeasuredPhase5thHarmonicCurrent namespace MeasuredPhase7thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredPhase7thHarmonicCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredPhase7thHarmonicCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MeasuredPhase7thHarmonicCurrent namespace MeasuredPhase9thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredPhase9thHarmonicCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredPhase9thHarmonicCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MeasuredPhase9thHarmonicCurrent namespace MeasuredPhase11thHarmonicCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * measuredPhase11thHarmonicCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t measuredPhase11thHarmonicCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace MeasuredPhase11thHarmonicCurrent namespace AcFrequencyMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acFrequencyMultiplier); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequencyMultiplier); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AcFrequencyMultiplier namespace AcFrequencyDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acFrequencyDivisor); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acFrequencyDivisor); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AcFrequencyDivisor namespace PowerMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * powerMultiplier); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t powerMultiplier); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace PowerMultiplier namespace PowerDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * powerDivisor); // int32u -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t powerDivisor); +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace PowerDivisor namespace HarmonicCurrentMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * harmonicCurrentMultiplier); // int8s -EmberAfStatus Set(chip::EndpointId endpoint, int8_t harmonicCurrentMultiplier); +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value); // int8s +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value); } // namespace HarmonicCurrentMultiplier namespace PhaseHarmonicCurrentMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * phaseHarmonicCurrentMultiplier); // int8s -EmberAfStatus Set(chip::EndpointId endpoint, int8_t phaseHarmonicCurrentMultiplier); +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value); // int8s +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value); } // namespace PhaseHarmonicCurrentMultiplier namespace InstantaneousVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * instantaneousVoltage); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t instantaneousVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace InstantaneousVoltage namespace InstantaneousLineCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * instantaneousLineCurrent); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t instantaneousLineCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace InstantaneousLineCurrent namespace InstantaneousActiveCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * instantaneousActiveCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t instantaneousActiveCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace InstantaneousActiveCurrent namespace InstantaneousReactiveCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * instantaneousReactiveCurrent); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t instantaneousReactiveCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace InstantaneousReactiveCurrent namespace InstantaneousPower { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * instantaneousPower); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t instantaneousPower); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace InstantaneousPower namespace RmsVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltage); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltage namespace RmsVoltageMin { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageMin); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMin); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltageMin namespace RmsVoltageMax { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageMax); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMax); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltageMax namespace RmsCurrent { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrent); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrent); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsCurrent namespace RmsCurrentMin { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentMin); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMin); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsCurrentMin namespace RmsCurrentMax { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentMax); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMax); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsCurrentMax namespace ActivePower { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePower); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePower); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ActivePower namespace ActivePowerMin { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerMin); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMin); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ActivePowerMin namespace ActivePowerMax { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerMax); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMax); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ActivePowerMax namespace ReactivePower { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * reactivePower); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactivePower); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ReactivePower namespace ApparentPower { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * apparentPower); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t apparentPower); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ApparentPower namespace PowerFactor { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * powerFactor); // int8s -EmberAfStatus Set(chip::EndpointId endpoint, int8_t powerFactor); +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value); // int8s +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value); } // namespace PowerFactor namespace AverageRmsVoltageMeasurementPeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsVoltageMeasurementPeriod); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsVoltageMeasurementPeriod); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AverageRmsVoltageMeasurementPeriod namespace AverageRmsUnderVoltageCounter { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsUnderVoltageCounter); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsUnderVoltageCounter); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AverageRmsUnderVoltageCounter namespace RmsExtremeOverVoltagePeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsExtremeOverVoltagePeriod); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeOverVoltagePeriod); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsExtremeOverVoltagePeriod namespace RmsExtremeUnderVoltagePeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsExtremeUnderVoltagePeriod); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeUnderVoltagePeriod); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsExtremeUnderVoltagePeriod namespace RmsVoltageSagPeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageSagPeriod); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriod); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltageSagPeriod namespace RmsVoltageSwellPeriod { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageSwellPeriod); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriod); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltageSwellPeriod namespace AcVoltageMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acVoltageMultiplier); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acVoltageMultiplier); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AcVoltageMultiplier namespace AcVoltageDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acVoltageDivisor); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acVoltageDivisor); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AcVoltageDivisor namespace AcCurrentMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acCurrentMultiplier); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acCurrentMultiplier); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AcCurrentMultiplier namespace AcCurrentDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acCurrentDivisor); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acCurrentDivisor); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AcCurrentDivisor namespace AcPowerMultiplier { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acPowerMultiplier); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acPowerMultiplier); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AcPowerMultiplier namespace AcPowerDivisor { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acPowerDivisor); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acPowerDivisor); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AcPowerDivisor namespace OverloadAlarmsMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * overloadAlarmsMask); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t overloadAlarmsMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace OverloadAlarmsMask namespace VoltageOverload { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * voltageOverload); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t voltageOverload); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace VoltageOverload namespace CurrentOverload { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * currentOverload); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t currentOverload); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace CurrentOverload namespace AcOverloadAlarmsMask { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * acOverloadAlarmsMask); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t acOverloadAlarmsMask); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AcOverloadAlarmsMask namespace AcVoltageOverload { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * acVoltageOverload); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t acVoltageOverload); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace AcVoltageOverload namespace AcCurrentOverload { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * acCurrentOverload); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t acCurrentOverload); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace AcCurrentOverload namespace AcActivePowerOverload { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * acActivePowerOverload); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t acActivePowerOverload); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace AcActivePowerOverload namespace AcReactivePowerOverload { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * acReactivePowerOverload); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t acReactivePowerOverload); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace AcReactivePowerOverload namespace AverageRmsOverVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * averageRmsOverVoltage); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t averageRmsOverVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace AverageRmsOverVoltage namespace AverageRmsUnderVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * averageRmsUnderVoltage); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t averageRmsUnderVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace AverageRmsUnderVoltage namespace RmsExtremeOverVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * rmsExtremeOverVoltage); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t rmsExtremeOverVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace RmsExtremeOverVoltage namespace RmsExtremeUnderVoltage { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * rmsExtremeUnderVoltage); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t rmsExtremeUnderVoltage); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace RmsExtremeUnderVoltage namespace RmsVoltageSag { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * rmsVoltageSag); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t rmsVoltageSag); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace RmsVoltageSag namespace RmsVoltageSwell { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * rmsVoltageSwell); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t rmsVoltageSwell); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace RmsVoltageSwell namespace LineCurrentPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * lineCurrentPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t lineCurrentPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace LineCurrentPhaseB namespace ActiveCurrentPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activeCurrentPhaseB); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activeCurrentPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ActiveCurrentPhaseB namespace ReactiveCurrentPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * reactiveCurrentPhaseB); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactiveCurrentPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ReactiveCurrentPhaseB namespace RmsVoltagePhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltagePhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltagePhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltagePhaseB namespace RmsVoltageMinPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageMinPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMinPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltageMinPhaseB namespace RmsVoltageMaxPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageMaxPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMaxPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltageMaxPhaseB namespace RmsCurrentPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsCurrentPhaseB namespace RmsCurrentMinPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentMinPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMinPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsCurrentMinPhaseB namespace RmsCurrentMaxPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentMaxPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMaxPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsCurrentMaxPhaseB namespace ActivePowerPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerPhaseB); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ActivePowerPhaseB namespace ActivePowerMinPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerMinPhaseB); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMinPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ActivePowerMinPhaseB namespace ActivePowerMaxPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerMaxPhaseB); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMaxPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ActivePowerMaxPhaseB namespace ReactivePowerPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * reactivePowerPhaseB); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactivePowerPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ReactivePowerPhaseB namespace ApparentPowerPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * apparentPowerPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t apparentPowerPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ApparentPowerPhaseB namespace PowerFactorPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * powerFactorPhaseB); // int8s -EmberAfStatus Set(chip::EndpointId endpoint, int8_t powerFactorPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value); // int8s +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value); } // namespace PowerFactorPhaseB namespace AverageRmsVoltageMeasurementPeriodPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsVoltageMeasurementPeriodPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsVoltageMeasurementPeriodPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AverageRmsVoltageMeasurementPeriodPhaseB namespace AverageRmsOverVoltageCounterPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsOverVoltageCounterPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsOverVoltageCounterPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AverageRmsOverVoltageCounterPhaseB namespace AverageRmsUnderVoltageCounterPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsUnderVoltageCounterPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsUnderVoltageCounterPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AverageRmsUnderVoltageCounterPhaseB namespace RmsExtremeOverVoltagePeriodPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsExtremeOverVoltagePeriodPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeOverVoltagePeriodPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsExtremeOverVoltagePeriodPhaseB namespace RmsExtremeUnderVoltagePeriodPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsExtremeUnderVoltagePeriodPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeUnderVoltagePeriodPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsExtremeUnderVoltagePeriodPhaseB namespace RmsVoltageSagPeriodPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageSagPeriodPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriodPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltageSagPeriodPhaseB namespace RmsVoltageSwellPeriodPhaseB { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageSwellPeriodPhaseB); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriodPhaseB); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltageSwellPeriodPhaseB namespace LineCurrentPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * lineCurrentPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t lineCurrentPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace LineCurrentPhaseC namespace ActiveCurrentPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activeCurrentPhaseC); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activeCurrentPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ActiveCurrentPhaseC namespace ReactiveCurrentPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * reactiveCurrentPhaseC); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactiveCurrentPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ReactiveCurrentPhaseC namespace RmsVoltagePhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltagePhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltagePhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltagePhaseC namespace RmsVoltageMinPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageMinPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMinPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltageMinPhaseC namespace RmsVoltageMaxPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageMaxPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageMaxPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltageMaxPhaseC namespace RmsCurrentPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsCurrentPhaseC namespace RmsCurrentMinPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentMinPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMinPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsCurrentMinPhaseC namespace RmsCurrentMaxPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsCurrentMaxPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsCurrentMaxPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsCurrentMaxPhaseC namespace ActivePowerPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerPhaseC); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ActivePowerPhaseC namespace ActivePowerMinPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerMinPhaseC); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMinPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ActivePowerMinPhaseC namespace ActivePowerMaxPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * activePowerMaxPhaseC); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t activePowerMaxPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ActivePowerMaxPhaseC namespace ReactivePowerPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int16_t * reactivePowerPhaseC); // int16s -EmberAfStatus Set(chip::EndpointId endpoint, int16_t reactivePowerPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, int16_t * value); // int16s +EmberAfStatus Set(chip::EndpointId endpoint, int16_t value); } // namespace ReactivePowerPhaseC namespace ApparentPowerPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * apparentPowerPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t apparentPowerPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ApparentPowerPhaseC namespace PowerFactorPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, int8_t * powerFactorPhaseC); // int8s -EmberAfStatus Set(chip::EndpointId endpoint, int8_t powerFactorPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, int8_t * value); // int8s +EmberAfStatus Set(chip::EndpointId endpoint, int8_t value); } // namespace PowerFactorPhaseC namespace AverageRmsVoltageMeasurementPeriodPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsVoltageMeasurementPeriodPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsVoltageMeasurementPeriodPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AverageRmsVoltageMeasurementPeriodPhaseC namespace AverageRmsOverVoltageCounterPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsOverVoltageCounterPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsOverVoltageCounterPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AverageRmsOverVoltageCounterPhaseC namespace AverageRmsUnderVoltageCounterPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * averageRmsUnderVoltageCounterPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t averageRmsUnderVoltageCounterPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace AverageRmsUnderVoltageCounterPhaseC namespace RmsExtremeOverVoltagePeriodPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsExtremeOverVoltagePeriodPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeOverVoltagePeriodPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsExtremeOverVoltagePeriodPhaseC namespace RmsExtremeUnderVoltagePeriodPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsExtremeUnderVoltagePeriodPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsExtremeUnderVoltagePeriodPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsExtremeUnderVoltagePeriodPhaseC namespace RmsVoltageSagPeriodPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageSagPeriodPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSagPeriodPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltageSagPeriodPhaseC namespace RmsVoltageSwellPeriodPhaseC { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * rmsVoltageSwellPeriodPhaseC); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t rmsVoltageSwellPeriodPhaseC); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace RmsVoltageSwellPeriodPhaseC } // namespace Attributes @@ -4658,13 +4993,13 @@ namespace SampleMfgSpecificCluster { namespace Attributes { namespace EmberSampleAttribute { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * emberSampleAttribute); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t emberSampleAttribute); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace EmberSampleAttribute namespace EmberSampleAttribute2 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * emberSampleAttribute2); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t emberSampleAttribute2); +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace EmberSampleAttribute2 } // namespace Attributes @@ -4674,13 +5009,13 @@ namespace SampleMfgSpecificCluster2 { namespace Attributes { namespace EmberSampleAttribute3 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * emberSampleAttribute3); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t emberSampleAttribute3); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace EmberSampleAttribute3 namespace EmberSampleAttribute4 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * emberSampleAttribute4); // int16u -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t emberSampleAttribute4); +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace EmberSampleAttribute4 } // 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 4548ae7c8d6a8a..165084b9c3b120 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -13903,12 +13903,34 @@ bool emberAfTestClusterClusterTestEnumsResponseCallback(chip::EndpointId endpoin bool emberAfTestClusterClusterTestStructArrayArgumentRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::TestCluster::Commands::TestStructArrayArgumentRequest::DecodableType & commandData); +/** + * @brief Test Cluster Cluster TestNullableOptionalResponse Command callback (from server) + */ +bool emberAfTestClusterClusterTestNullableOptionalResponseCallback(chip::EndpointId endpoint, chip::app::CommandSender * commandObj, + bool wasPresent, bool wasNull, uint8_t value); /** * @brief Test Cluster Cluster TestStructArgumentRequest Command callback (from client) */ bool emberAfTestClusterClusterTestStructArgumentRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::TestCluster::Commands::TestStructArgumentRequest::DecodableType & commandData); +/** + * @brief Test Cluster Cluster TestComplexNullableOptionalResponse Command callback (from server) + */ +bool emberAfTestClusterClusterTestComplexNullableOptionalResponseCallback( + chip::EndpointId endpoint, chip::app::CommandSender * commandObj, bool NullableIntWasNull, uint16_t NullableIntValue, + bool OptionalIntWasPresent, uint16_t OptionalIntValue, bool NullableOptionalIntWasPresent, bool NullableOptionalIntWasNull, + uint16_t NullableOptionalIntValue, bool NullableStringWasNull, chip::CharSpan NullableStringValue, + bool OptionalStringWasPresent, chip::CharSpan OptionalStringValue, bool NullableOptionalStringWasPresent, + bool NullableOptionalStringWasNull, chip::CharSpan NullableOptionalStringValue, bool NullableStructWasNull, + chip::Optional NullableStructValue, + bool OptionalStructWasPresent, + chip::Optional OptionalStructValue, + bool NullableOptionalStructWasPresent, bool NullableOptionalStructWasNull, + chip::Optional NullableOptionalStructValue, + bool NullableListWasNull, /* TYPE WARNING: array array defaults to */ uint8_t * NullableListValue, bool OptionalListWasPresent, + /* TYPE WARNING: array array defaults to */ uint8_t * OptionalListValue, bool NullableOptionalListWasPresent, + bool NullableOptionalListWasNull, /* TYPE WARNING: array array defaults to */ uint8_t * NullableOptionalListValue); /** * @brief Test Cluster Cluster TestNestedStructArgumentRequest Command callback (from client) */ @@ -13951,6 +13973,18 @@ bool emberAfTestClusterClusterTestListInt8UReverseRequestCallback( bool emberAfTestClusterClusterTestEnumsRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::TestCluster::Commands::TestEnumsRequest::DecodableType & commandData); +/** + * @brief Test Cluster Cluster TestNullableOptionalRequest Command callback (from client) + */ +bool emberAfTestClusterClusterTestNullableOptionalRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::DecodableType & commandData); +/** + * @brief Test Cluster Cluster TestComplexNullableOptionalRequest Command callback (from client) + */ +bool emberAfTestClusterClusterTestComplexNullableOptionalRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::TestCluster::Commands::TestComplexNullableOptionalRequest::DecodableType & commandData); /** * @brief Messaging Cluster DisplayMessage Command callback (from server) */ 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 6782e18166dc0f..3f262128adf0ae 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 @@ -15121,6 +15121,90 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } // namespace SimpleStruct +namespace NullablesAndOptionalsStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableInt)), nullableInt)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalInt)), optionalInt)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalInt)), nullableOptionalInt)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableString)), nullableString)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalString)), optionalString)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalString)), nullableOptionalString)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableStruct)), nullableStruct)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalStruct)), optionalStruct)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalStruct)), nullableOptionalStruct)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableList)), nullableList)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalList)), optionalList)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalList)), nullableOptionalList)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kNullableInt): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableInt)); + break; + case to_underlying(Fields::kOptionalInt): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalInt)); + break; + case to_underlying(Fields::kNullableOptionalInt): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalInt)); + break; + case to_underlying(Fields::kNullableString): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableString)); + break; + case to_underlying(Fields::kOptionalString): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalString)); + break; + case to_underlying(Fields::kNullableOptionalString): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalString)); + break; + case to_underlying(Fields::kNullableStruct): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableStruct)); + break; + case to_underlying(Fields::kOptionalStruct): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalStruct)); + break; + case to_underlying(Fields::kNullableOptionalStruct): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalStruct)); + break; + case to_underlying(Fields::kNullableList): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableList)); + break; + case to_underlying(Fields::kOptionalList): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalList)); + break; + case to_underlying(Fields::kNullableOptionalList): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalList)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} + +} // namespace NullablesAndOptionalsStruct namespace NestedStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -15778,6 +15862,48 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace TestStructArrayArgumentRequest. +namespace TestNullableOptionalResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kWasPresent)), wasPresent)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kWasNull)), wasNull)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kValue)), value)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kWasPresent): + ReturnErrorOnFailure(DataModel::Decode(reader, wasPresent)); + break; + case to_underlying(Fields::kWasNull): + ReturnErrorOnFailure(DataModel::Decode(reader, wasNull)); + break; + case to_underlying(Fields::kValue): + ReturnErrorOnFailure(DataModel::Decode(reader, value)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace TestNullableOptionalResponse. namespace TestStructArgumentRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -15812,6 +15938,172 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace TestStructArgumentRequest. +namespace TestComplexNullableOptionalResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableIntWasNull)), nullableIntWasNull)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableIntValue)), nullableIntValue)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalIntWasPresent)), optionalIntWasPresent)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalIntValue)), optionalIntValue)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalIntWasPresent)), + nullableOptionalIntWasPresent)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalIntWasNull)), nullableOptionalIntWasNull)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalIntValue)), nullableOptionalIntValue)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableStringWasNull)), nullableStringWasNull)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableStringValue)), nullableStringValue)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalStringWasPresent)), optionalStringWasPresent)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalStringValue)), optionalStringValue)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalStringWasPresent)), + nullableOptionalStringWasPresent)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalStringWasNull)), + nullableOptionalStringWasNull)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalStringValue)), + nullableOptionalStringValue)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableStructWasNull)), nullableStructWasNull)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableStructValue)), nullableStructValue)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalStructWasPresent)), optionalStructWasPresent)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalStructValue)), optionalStructValue)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalStructWasPresent)), + nullableOptionalStructWasPresent)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalStructWasNull)), + nullableOptionalStructWasNull)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalStructValue)), + nullableOptionalStructValue)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableListWasNull)), nullableListWasNull)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableListValue)), nullableListValue)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalListWasPresent)), optionalListWasPresent)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalListValue)), optionalListValue)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalListWasPresent)), + nullableOptionalListWasPresent)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalListWasNull)), + nullableOptionalListWasNull)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalListValue)), nullableOptionalListValue)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kNullableIntWasNull): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableIntWasNull)); + break; + case to_underlying(Fields::kNullableIntValue): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableIntValue)); + break; + case to_underlying(Fields::kOptionalIntWasPresent): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalIntWasPresent)); + break; + case to_underlying(Fields::kOptionalIntValue): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalIntValue)); + break; + case to_underlying(Fields::kNullableOptionalIntWasPresent): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalIntWasPresent)); + break; + case to_underlying(Fields::kNullableOptionalIntWasNull): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalIntWasNull)); + break; + case to_underlying(Fields::kNullableOptionalIntValue): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalIntValue)); + break; + case to_underlying(Fields::kNullableStringWasNull): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableStringWasNull)); + break; + case to_underlying(Fields::kNullableStringValue): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableStringValue)); + break; + case to_underlying(Fields::kOptionalStringWasPresent): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalStringWasPresent)); + break; + case to_underlying(Fields::kOptionalStringValue): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalStringValue)); + break; + case to_underlying(Fields::kNullableOptionalStringWasPresent): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalStringWasPresent)); + break; + case to_underlying(Fields::kNullableOptionalStringWasNull): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalStringWasNull)); + break; + case to_underlying(Fields::kNullableOptionalStringValue): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalStringValue)); + break; + case to_underlying(Fields::kNullableStructWasNull): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableStructWasNull)); + break; + case to_underlying(Fields::kNullableStructValue): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableStructValue)); + break; + case to_underlying(Fields::kOptionalStructWasPresent): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalStructWasPresent)); + break; + case to_underlying(Fields::kOptionalStructValue): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalStructValue)); + break; + case to_underlying(Fields::kNullableOptionalStructWasPresent): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalStructWasPresent)); + break; + case to_underlying(Fields::kNullableOptionalStructWasNull): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalStructWasNull)); + break; + case to_underlying(Fields::kNullableOptionalStructValue): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalStructValue)); + break; + case to_underlying(Fields::kNullableListWasNull): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableListWasNull)); + break; + case to_underlying(Fields::kNullableListValue): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableListValue)); + break; + case to_underlying(Fields::kOptionalListWasPresent): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalListWasPresent)); + break; + case to_underlying(Fields::kOptionalListValue): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalListValue)); + break; + case to_underlying(Fields::kNullableOptionalListWasPresent): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalListWasPresent)); + break; + case to_underlying(Fields::kNullableOptionalListWasNull): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalListWasNull)); + break; + case to_underlying(Fields::kNullableOptionalListValue): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalListValue)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace TestComplexNullableOptionalResponse. namespace TestNestedStructArgumentRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -16054,6 +16346,122 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace TestEnumsRequest. +namespace TestNullableOptionalRequest { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kArg1)), arg1)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kArg1): + ReturnErrorOnFailure(DataModel::Decode(reader, arg1)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace TestNullableOptionalRequest. +namespace TestComplexNullableOptionalRequest { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableInt)), nullableInt)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalInt)), optionalInt)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalInt)), nullableOptionalInt)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableString)), nullableString)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalString)), optionalString)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalString)), nullableOptionalString)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableStruct)), nullableStruct)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalStruct)), optionalStruct)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalStruct)), nullableOptionalStruct)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableList)), nullableList)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kOptionalList)), optionalList)); + ReturnErrorOnFailure( + DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kNullableOptionalList)), nullableOptionalList)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kNullableInt): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableInt)); + break; + case to_underlying(Fields::kOptionalInt): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalInt)); + break; + case to_underlying(Fields::kNullableOptionalInt): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalInt)); + break; + case to_underlying(Fields::kNullableString): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableString)); + break; + case to_underlying(Fields::kOptionalString): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalString)); + break; + case to_underlying(Fields::kNullableOptionalString): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalString)); + break; + case to_underlying(Fields::kNullableStruct): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableStruct)); + break; + case to_underlying(Fields::kOptionalStruct): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalStruct)); + break; + case to_underlying(Fields::kNullableOptionalStruct): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalStruct)); + break; + case to_underlying(Fields::kNullableList): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableList)); + break; + case to_underlying(Fields::kOptionalList): + ReturnErrorOnFailure(DataModel::Decode(reader, optionalList)); + break; + case to_underlying(Fields::kNullableOptionalList): + ReturnErrorOnFailure(DataModel::Decode(reader, nullableOptionalList)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace TestComplexNullableOptionalRequest. } // namespace Commands namespace Events { 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 7b27f3a1695343..f4754dc19fce03 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 @@ -802,8 +802,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Identify::Id; } - static constexpr ClusterId GetClusterId() { return Identify::Id; } + static constexpr CommandId GetCommandId() { return Commands::Identify::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Identify::Id; } uint16_t identifyTime; @@ -813,8 +813,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Identify::Id; } - static constexpr ClusterId GetClusterId() { return Identify::Id; } + static constexpr CommandId GetCommandId() { return Commands::Identify::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Identify::Id; } uint16_t identifyTime; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -830,8 +830,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return IdentifyQueryResponse::Id; } - static constexpr ClusterId GetClusterId() { return Identify::Id; } + static constexpr CommandId GetCommandId() { return Commands::IdentifyQueryResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Identify::Id; } uint16_t timeout; @@ -841,8 +841,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return IdentifyQueryResponse::Id; } - static constexpr ClusterId GetClusterId() { return Identify::Id; } + static constexpr CommandId GetCommandId() { return Commands::IdentifyQueryResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Identify::Id; } uint16_t timeout; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -857,8 +857,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return IdentifyQuery::Id; } - static constexpr ClusterId GetClusterId() { return Identify::Id; } + static constexpr CommandId GetCommandId() { return Commands::IdentifyQuery::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Identify::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -866,8 +866,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return IdentifyQuery::Id; } - static constexpr ClusterId GetClusterId() { return Identify::Id; } + static constexpr CommandId GetCommandId() { return Commands::IdentifyQuery::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Identify::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -883,8 +883,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TriggerEffect::Id; } - static constexpr ClusterId GetClusterId() { return Identify::Id; } + static constexpr CommandId GetCommandId() { return Commands::TriggerEffect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Identify::Id; } IdentifyEffectIdentifier effectIdentifier; IdentifyEffectVariant effectVariant; @@ -895,8 +895,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TriggerEffect::Id; } - static constexpr ClusterId GetClusterId() { return Identify::Id; } + static constexpr CommandId GetCommandId() { return Commands::TriggerEffect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Identify::Id; } IdentifyEffectIdentifier effectIdentifier; IdentifyEffectVariant effectVariant; @@ -962,8 +962,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AddGroup::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddGroup::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint16_t groupId; chip::CharSpan groupName; @@ -974,8 +974,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AddGroup::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddGroup::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint16_t groupId; chip::CharSpan groupName; @@ -993,8 +993,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AddGroupResponse::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddGroupResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint8_t status; uint16_t groupId; @@ -1005,8 +1005,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AddGroupResponse::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddGroupResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint8_t status; uint16_t groupId; @@ -1023,8 +1023,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ViewGroup::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::ViewGroup::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint16_t groupId; @@ -1034,8 +1034,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ViewGroup::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::ViewGroup::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint16_t groupId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -1053,8 +1053,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ViewGroupResponse::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::ViewGroupResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint8_t status; uint16_t groupId; @@ -1066,8 +1066,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ViewGroupResponse::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::ViewGroupResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint8_t status; uint16_t groupId; @@ -1086,8 +1086,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetGroupMembership::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetGroupMembership::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint8_t groupCount; DataModel::List groupList; @@ -1098,8 +1098,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetGroupMembership::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetGroupMembership::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint8_t groupCount; DataModel::DecodableList groupList; @@ -1118,8 +1118,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetGroupMembershipResponse::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetGroupMembershipResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint8_t capacity; uint8_t groupCount; @@ -1131,8 +1131,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetGroupMembershipResponse::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetGroupMembershipResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint8_t capacity; uint8_t groupCount; @@ -1150,8 +1150,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RemoveGroup::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveGroup::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint16_t groupId; @@ -1161,8 +1161,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RemoveGroup::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveGroup::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint16_t groupId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -1179,8 +1179,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RemoveGroupResponse::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveGroupResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint8_t status; uint16_t groupId; @@ -1191,8 +1191,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RemoveGroupResponse::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveGroupResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint8_t status; uint16_t groupId; @@ -1208,8 +1208,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RemoveAllGroups::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveAllGroups::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -1217,8 +1217,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RemoveAllGroups::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveAllGroups::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -1234,8 +1234,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AddGroupIfIdentifying::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddGroupIfIdentifying::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint16_t groupId; chip::CharSpan groupName; @@ -1246,8 +1246,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AddGroupIfIdentifying::Id; } - static constexpr ClusterId GetClusterId() { return Groups::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddGroupIfIdentifying::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Groups::Id; } uint16_t groupId; chip::CharSpan groupName; @@ -1337,8 +1337,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AddScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1352,8 +1352,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AddScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1375,8 +1375,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AddSceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddSceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1388,8 +1388,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AddSceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddSceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1408,8 +1408,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ViewScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::ViewScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1420,8 +1420,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ViewScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::ViewScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1443,8 +1443,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ViewSceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::ViewSceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1459,8 +1459,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ViewSceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::ViewSceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1482,8 +1482,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RemoveScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1494,8 +1494,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RemoveScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1514,8 +1514,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RemoveSceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveSceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1527,8 +1527,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RemoveSceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveSceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1546,8 +1546,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RemoveAllScenes::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveAllScenes::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; @@ -1557,8 +1557,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RemoveAllScenes::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveAllScenes::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -1575,8 +1575,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RemoveAllScenesResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveAllScenesResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1587,8 +1587,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RemoveAllScenesResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveAllScenesResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1606,8 +1606,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StoreScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::StoreScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1618,8 +1618,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StoreScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::StoreScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1638,8 +1638,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StoreSceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::StoreSceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1651,8 +1651,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StoreSceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::StoreSceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1672,8 +1672,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RecallScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::RecallScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1685,8 +1685,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RecallScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::RecallScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1704,8 +1704,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetSceneMembership::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetSceneMembership::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; @@ -1715,8 +1715,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetSceneMembership::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetSceneMembership::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -1736,8 +1736,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetSceneMembershipResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetSceneMembershipResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint8_t capacity; @@ -1751,8 +1751,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetSceneMembershipResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetSceneMembershipResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint8_t capacity; @@ -1776,8 +1776,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnhancedAddScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedAddScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1791,8 +1791,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnhancedAddScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedAddScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1814,8 +1814,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnhancedAddSceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedAddSceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1827,8 +1827,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnhancedAddSceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedAddSceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1847,8 +1847,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnhancedViewScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedViewScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1859,8 +1859,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnhancedViewScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedViewScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint16_t groupId; uint8_t sceneId; @@ -1882,8 +1882,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnhancedViewSceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedViewSceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1898,8 +1898,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnhancedViewSceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedViewSceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupId; @@ -1924,8 +1924,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return CopyScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::CopyScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } chip::BitFlags mode; uint16_t groupIdFrom; @@ -1939,8 +1939,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return CopyScene::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::CopyScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } chip::BitFlags mode; uint16_t groupIdFrom; @@ -1962,8 +1962,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return CopySceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::CopySceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupIdFrom; @@ -1975,8 +1975,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return CopySceneResponse::Id; } - static constexpr ClusterId GetClusterId() { return Scenes::Id; } + static constexpr CommandId GetCommandId() { return Commands::CopySceneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } uint8_t status; uint16_t groupIdFrom; @@ -2123,8 +2123,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Off::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::Off::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -2132,8 +2132,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Off::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::Off::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -2147,8 +2147,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SampleMfgSpecificOffWithTransition::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::SampleMfgSpecificOffWithTransition::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -2156,8 +2156,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SampleMfgSpecificOffWithTransition::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::SampleMfgSpecificOffWithTransition::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -2171,8 +2171,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return On::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::On::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -2180,8 +2180,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return On::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::On::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -2195,8 +2195,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SampleMfgSpecificOnWithTransition::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::SampleMfgSpecificOnWithTransition::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -2204,8 +2204,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SampleMfgSpecificOnWithTransition::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::SampleMfgSpecificOnWithTransition::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -2219,8 +2219,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SampleMfgSpecificOnWithTransition2::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::SampleMfgSpecificOnWithTransition2::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -2228,8 +2228,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SampleMfgSpecificOnWithTransition2::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::SampleMfgSpecificOnWithTransition2::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -2243,8 +2243,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Toggle::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::Toggle::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -2252,8 +2252,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Toggle::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::Toggle::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -2267,8 +2267,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SampleMfgSpecificToggleWithTransition::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::SampleMfgSpecificToggleWithTransition::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -2276,8 +2276,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SampleMfgSpecificToggleWithTransition::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::SampleMfgSpecificToggleWithTransition::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -2291,8 +2291,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SampleMfgSpecificToggleWithTransition2::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::SampleMfgSpecificToggleWithTransition2::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -2300,8 +2300,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SampleMfgSpecificToggleWithTransition2::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::SampleMfgSpecificToggleWithTransition2::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -2317,8 +2317,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return OffWithEffect::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::OffWithEffect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } OnOffEffectIdentifier effectId; OnOffDelayedAllOffEffectVariant effectVariant; @@ -2329,8 +2329,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return OffWithEffect::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::OffWithEffect::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } OnOffEffectIdentifier effectId; OnOffDelayedAllOffEffectVariant effectVariant; @@ -2346,8 +2346,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return OnWithRecallGlobalScene::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::OnWithRecallGlobalScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -2355,8 +2355,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return OnWithRecallGlobalScene::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::OnWithRecallGlobalScene::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -2373,8 +2373,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return OnWithTimedOff::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::OnWithTimedOff::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } chip::BitFlags onOffControl; uint16_t onTime; @@ -2386,8 +2386,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return OnWithTimedOff::Id; } - static constexpr ClusterId GetClusterId() { return OnOff::Id; } + static constexpr CommandId GetCommandId() { return Commands::OnWithTimedOff::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } chip::BitFlags onOffControl; uint16_t onTime; @@ -2595,8 +2595,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MoveToLevel::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToLevel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } uint8_t level; uint16_t transitionTime; @@ -2609,8 +2609,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MoveToLevel::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToLevel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } uint8_t level; uint16_t transitionTime; @@ -2632,8 +2632,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Move::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::Move::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } MoveMode moveMode; uint8_t rate; @@ -2646,8 +2646,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Move::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::Move::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } MoveMode moveMode; uint8_t rate; @@ -2670,8 +2670,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Step::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::Step::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } StepMode stepMode; uint8_t stepSize; @@ -2685,8 +2685,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Step::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::Step::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } StepMode stepMode; uint8_t stepSize; @@ -2707,8 +2707,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Stop::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::Stop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } uint8_t optionMask; uint8_t optionOverride; @@ -2719,8 +2719,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Stop::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::Stop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } uint8_t optionMask; uint8_t optionOverride; @@ -2738,8 +2738,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MoveToLevelWithOnOff::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToLevelWithOnOff::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } uint8_t level; uint16_t transitionTime; @@ -2750,8 +2750,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MoveToLevelWithOnOff::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToLevelWithOnOff::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } uint8_t level; uint16_t transitionTime; @@ -2769,8 +2769,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MoveWithOnOff::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveWithOnOff::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } MoveMode moveMode; uint8_t rate; @@ -2781,8 +2781,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MoveWithOnOff::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveWithOnOff::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } MoveMode moveMode; uint8_t rate; @@ -2801,8 +2801,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StepWithOnOff::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StepWithOnOff::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } StepMode stepMode; uint8_t stepSize; @@ -2814,8 +2814,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StepWithOnOff::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StepWithOnOff::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } StepMode stepMode; uint8_t stepSize; @@ -2832,8 +2832,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StopWithOnOff::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StopWithOnOff::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -2841,8 +2841,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StopWithOnOff::Id; } - static constexpr ClusterId GetClusterId() { return LevelControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StopWithOnOff::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LevelControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -3026,8 +3026,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ResetAlarm::Id; } - static constexpr ClusterId GetClusterId() { return Alarms::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetAlarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Alarms::Id; } uint8_t alarmCode; chip::ClusterId clusterId; @@ -3038,8 +3038,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ResetAlarm::Id; } - static constexpr ClusterId GetClusterId() { return Alarms::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetAlarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Alarms::Id; } uint8_t alarmCode; chip::ClusterId clusterId; @@ -3057,8 +3057,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Alarm::Id; } - static constexpr ClusterId GetClusterId() { return Alarms::Id; } + static constexpr CommandId GetCommandId() { return Commands::Alarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Alarms::Id; } uint8_t alarmCode; chip::ClusterId clusterId; @@ -3069,8 +3069,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Alarm::Id; } - static constexpr ClusterId GetClusterId() { return Alarms::Id; } + static constexpr CommandId GetCommandId() { return Commands::Alarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Alarms::Id; } uint8_t alarmCode; chip::ClusterId clusterId; @@ -3086,8 +3086,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ResetAllAlarms::Id; } - static constexpr ClusterId GetClusterId() { return Alarms::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetAllAlarms::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Alarms::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -3095,8 +3095,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ResetAllAlarms::Id; } - static constexpr ClusterId GetClusterId() { return Alarms::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetAllAlarms::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Alarms::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -3114,8 +3114,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetAlarmResponse::Id; } - static constexpr ClusterId GetClusterId() { return Alarms::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetAlarmResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Alarms::Id; } uint8_t status; uint8_t alarmCode; @@ -3128,8 +3128,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetAlarmResponse::Id; } - static constexpr ClusterId GetClusterId() { return Alarms::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetAlarmResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Alarms::Id; } uint8_t status; uint8_t alarmCode; @@ -3147,8 +3147,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetAlarm::Id; } - static constexpr ClusterId GetClusterId() { return Alarms::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetAlarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Alarms::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -3156,8 +3156,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetAlarm::Id; } - static constexpr ClusterId GetClusterId() { return Alarms::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetAlarm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Alarms::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -3171,8 +3171,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ResetAlarmLog::Id; } - static constexpr ClusterId GetClusterId() { return Alarms::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetAlarmLog::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Alarms::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -3180,8 +3180,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ResetAlarmLog::Id; } - static constexpr ClusterId GetClusterId() { return Alarms::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetAlarmLog::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Alarms::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -3549,8 +3549,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return PowerProfileRequest::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; @@ -3560,8 +3560,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return PowerProfileRequest::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -3580,8 +3580,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return PowerProfileNotification::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t totalProfileNum; uint8_t powerProfileId; @@ -3594,8 +3594,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return PowerProfileNotification::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t totalProfileNum; uint8_t powerProfileId; @@ -3613,8 +3613,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return PowerProfileStateRequest::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileStateRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -3622,8 +3622,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return PowerProfileStateRequest::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileStateRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -3641,8 +3641,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return PowerProfileResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t totalProfileNum; uint8_t powerProfileId; @@ -3655,8 +3655,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return PowerProfileResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t totalProfileNum; uint8_t powerProfileId; @@ -3678,8 +3678,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetPowerProfilePriceResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPowerProfilePriceResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint16_t currency; @@ -3692,8 +3692,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetPowerProfilePriceResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPowerProfilePriceResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint16_t currency; @@ -3713,8 +3713,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return PowerProfileStateResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileStateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileCount; DataModel::List powerProfileRecords; @@ -3725,8 +3725,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return PowerProfileStateResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileStateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileCount; DataModel::DecodableList powerProfileRecords; @@ -3745,8 +3745,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetOverallSchedulePriceResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetOverallSchedulePriceResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint16_t currency; uint32_t price; @@ -3758,8 +3758,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetOverallSchedulePriceResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetOverallSchedulePriceResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint16_t currency; uint32_t price; @@ -3777,8 +3777,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetPowerProfilePrice::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPowerProfilePrice::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; @@ -3788,8 +3788,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetPowerProfilePrice::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPowerProfilePrice::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -3807,8 +3807,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnergyPhasesScheduleNotification::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnergyPhasesScheduleNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint8_t numOfScheduledPhases; @@ -3820,8 +3820,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnergyPhasesScheduleNotification::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnergyPhasesScheduleNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint8_t numOfScheduledPhases; @@ -3840,8 +3840,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return PowerProfilesStateNotification::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfilesStateNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileCount; DataModel::List powerProfileRecords; @@ -3852,8 +3852,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return PowerProfilesStateNotification::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfilesStateNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileCount; DataModel::DecodableList powerProfileRecords; @@ -3872,8 +3872,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnergyPhasesScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnergyPhasesScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint8_t numOfScheduledPhases; @@ -3885,8 +3885,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnergyPhasesScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnergyPhasesScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint8_t numOfScheduledPhases; @@ -3903,8 +3903,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetOverallSchedulePrice::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetOverallSchedulePrice::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -3912,8 +3912,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetOverallSchedulePrice::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetOverallSchedulePrice::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -3928,8 +3928,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return PowerProfileScheduleConstraintsRequest::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileScheduleConstraintsRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; @@ -3939,8 +3939,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return PowerProfileScheduleConstraintsRequest::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileScheduleConstraintsRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -3956,8 +3956,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnergyPhasesScheduleRequest::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnergyPhasesScheduleRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; @@ -3967,8 +3967,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnergyPhasesScheduleRequest::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnergyPhasesScheduleRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -3984,8 +3984,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnergyPhasesScheduleStateRequest::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnergyPhasesScheduleStateRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; @@ -3995,8 +3995,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnergyPhasesScheduleStateRequest::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnergyPhasesScheduleStateRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -4014,8 +4014,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnergyPhasesScheduleStateResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnergyPhasesScheduleStateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint8_t numOfScheduledPhases; @@ -4027,8 +4027,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnergyPhasesScheduleStateResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnergyPhasesScheduleStateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint8_t numOfScheduledPhases; @@ -4049,8 +4049,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetPowerProfilePriceExtendedResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPowerProfilePriceExtendedResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint16_t currency; @@ -4063,8 +4063,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetPowerProfilePriceExtendedResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPowerProfilePriceExtendedResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint16_t currency; @@ -4085,8 +4085,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnergyPhasesScheduleStateNotification::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnergyPhasesScheduleStateNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint8_t numOfScheduledPhases; @@ -4098,8 +4098,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnergyPhasesScheduleStateNotification::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnergyPhasesScheduleStateNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint8_t numOfScheduledPhases; @@ -4119,8 +4119,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return PowerProfileScheduleConstraintsNotification::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileScheduleConstraintsNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint16_t startAfter; @@ -4132,8 +4132,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return PowerProfileScheduleConstraintsNotification::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileScheduleConstraintsNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint16_t startAfter; @@ -4153,8 +4153,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return PowerProfileScheduleConstraintsResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileScheduleConstraintsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint16_t startAfter; @@ -4166,8 +4166,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return PowerProfileScheduleConstraintsResponse::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::PowerProfileScheduleConstraintsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t powerProfileId; uint16_t startAfter; @@ -4187,8 +4187,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetPowerProfilePriceExtended::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPowerProfilePriceExtended::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t options; uint8_t powerProfileId; @@ -4200,8 +4200,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetPowerProfilePriceExtended::Id; } - static constexpr ClusterId GetClusterId() { return PowerProfile::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPowerProfilePriceExtended::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PowerProfile::Id; } uint8_t options; uint8_t powerProfileId; @@ -4365,8 +4365,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ExecutionOfACommand::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::ExecutionOfACommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } CommandIdentification commandId; @@ -4376,8 +4376,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ExecutionOfACommand::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::ExecutionOfACommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } CommandIdentification commandId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -4395,8 +4395,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SignalStateResponse::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::SignalStateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } ApplianceStatus applianceStatus; chip::BitFlags remoteEnableFlagsAndDeviceStatus2; @@ -4408,8 +4408,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SignalStateResponse::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::SignalStateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } ApplianceStatus applianceStatus; chip::BitFlags remoteEnableFlagsAndDeviceStatus2; @@ -4426,8 +4426,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SignalState::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::SignalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -4435,8 +4435,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SignalState::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::SignalState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -4453,8 +4453,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SignalStateNotification::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::SignalStateNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } ApplianceStatus applianceStatus; chip::BitFlags remoteEnableFlagsAndDeviceStatus2; @@ -4466,8 +4466,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SignalStateNotification::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::SignalStateNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } ApplianceStatus applianceStatus; chip::BitFlags remoteEnableFlagsAndDeviceStatus2; @@ -4487,8 +4487,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return WriteFunctions::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::WriteFunctions::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } uint16_t functionId; uint8_t functionDataType; @@ -4500,8 +4500,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return WriteFunctions::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::WriteFunctions::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } uint16_t functionId; uint8_t functionDataType; @@ -4518,8 +4518,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return OverloadPauseResume::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::OverloadPauseResume::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -4527,8 +4527,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return OverloadPauseResume::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::OverloadPauseResume::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -4542,8 +4542,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return OverloadPause::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::OverloadPause::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -4551,8 +4551,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return OverloadPause::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::OverloadPause::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -4567,8 +4567,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return OverloadWarning::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::OverloadWarning::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } WarningEvent warningEvent; @@ -4578,8 +4578,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return OverloadWarning::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::OverloadWarning::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } WarningEvent warningEvent; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -4740,8 +4740,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return CheckIn::Id; } - static constexpr ClusterId GetClusterId() { return PollControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::CheckIn::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PollControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -4749,8 +4749,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return CheckIn::Id; } - static constexpr ClusterId GetClusterId() { return PollControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::CheckIn::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PollControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -4766,8 +4766,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return CheckInResponse::Id; } - static constexpr ClusterId GetClusterId() { return PollControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::CheckInResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PollControl::Id; } bool startFastPolling; uint16_t fastPollTimeout; @@ -4778,8 +4778,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return CheckInResponse::Id; } - static constexpr ClusterId GetClusterId() { return PollControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::CheckInResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PollControl::Id; } bool startFastPolling; uint16_t fastPollTimeout; @@ -4795,8 +4795,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return FastPollStop::Id; } - static constexpr ClusterId GetClusterId() { return PollControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::FastPollStop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PollControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -4804,8 +4804,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return FastPollStop::Id; } - static constexpr ClusterId GetClusterId() { return PollControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::FastPollStop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PollControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -4820,8 +4820,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetLongPollInterval::Id; } - static constexpr ClusterId GetClusterId() { return PollControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetLongPollInterval::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PollControl::Id; } uint32_t newLongPollInterval; @@ -4831,8 +4831,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetLongPollInterval::Id; } - static constexpr ClusterId GetClusterId() { return PollControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetLongPollInterval::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PollControl::Id; } uint32_t newLongPollInterval; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -4848,8 +4848,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetShortPollInterval::Id; } - static constexpr ClusterId GetClusterId() { return PollControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetShortPollInterval::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PollControl::Id; } uint16_t newShortPollInterval; @@ -4859,8 +4859,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetShortPollInterval::Id; } - static constexpr ClusterId GetClusterId() { return PollControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetShortPollInterval::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PollControl::Id; } uint16_t newShortPollInterval; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -4973,8 +4973,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StartUp::Id; } - static constexpr ClusterId GetClusterId() { return Basic::Id; } + static constexpr CommandId GetCommandId() { return Commands::StartUp::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -4982,8 +4982,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StartUp::Id; } - static constexpr ClusterId GetClusterId() { return Basic::Id; } + static constexpr CommandId GetCommandId() { return Commands::StartUp::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -4997,8 +4997,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MfgSpecificPing::Id; } - static constexpr ClusterId GetClusterId() { return Basic::Id; } + static constexpr CommandId GetCommandId() { return Commands::MfgSpecificPing::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -5006,8 +5006,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MfgSpecificPing::Id; } - static constexpr ClusterId GetClusterId() { return Basic::Id; } + static constexpr CommandId GetCommandId() { return Commands::MfgSpecificPing::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -5021,8 +5021,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ShutDown::Id; } - static constexpr ClusterId GetClusterId() { return Basic::Id; } + static constexpr CommandId GetCommandId() { return Commands::ShutDown::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -5030,8 +5030,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ShutDown::Id; } - static constexpr ClusterId GetClusterId() { return Basic::Id; } + static constexpr CommandId GetCommandId() { return Commands::ShutDown::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -5045,8 +5045,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Leave::Id; } - static constexpr ClusterId GetClusterId() { return Basic::Id; } + static constexpr CommandId GetCommandId() { return Commands::Leave::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -5054,8 +5054,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Leave::Id; } - static constexpr ClusterId GetClusterId() { return Basic::Id; } + static constexpr CommandId GetCommandId() { return Commands::Leave::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Basic::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -5325,8 +5325,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return QueryImage::Id; } - static constexpr ClusterId GetClusterId() { return OtaSoftwareUpdateProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::QueryImage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } uint16_t vendorId; uint16_t productId; @@ -5343,8 +5343,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return QueryImage::Id; } - static constexpr ClusterId GetClusterId() { return OtaSoftwareUpdateProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::QueryImage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } uint16_t vendorId; uint16_t productId; @@ -5368,8 +5368,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ApplyUpdateRequest::Id; } - static constexpr ClusterId GetClusterId() { return OtaSoftwareUpdateProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::ApplyUpdateRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } chip::ByteSpan updateToken; uint32_t newVersion; @@ -5380,8 +5380,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ApplyUpdateRequest::Id; } - static constexpr ClusterId GetClusterId() { return OtaSoftwareUpdateProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::ApplyUpdateRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } chip::ByteSpan updateToken; uint32_t newVersion; @@ -5399,8 +5399,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return NotifyUpdateApplied::Id; } - static constexpr ClusterId GetClusterId() { return OtaSoftwareUpdateProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::NotifyUpdateApplied::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } chip::ByteSpan updateToken; uint32_t softwareVersion; @@ -5411,8 +5411,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return NotifyUpdateApplied::Id; } - static constexpr ClusterId GetClusterId() { return OtaSoftwareUpdateProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::NotifyUpdateApplied::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } chip::ByteSpan updateToken; uint32_t softwareVersion; @@ -5436,8 +5436,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return QueryImageResponse::Id; } - static constexpr ClusterId GetClusterId() { return OtaSoftwareUpdateProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::QueryImageResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } OTAQueryStatus status; uint32_t delayedActionTime; @@ -5454,8 +5454,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return QueryImageResponse::Id; } - static constexpr ClusterId GetClusterId() { return OtaSoftwareUpdateProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::QueryImageResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } OTAQueryStatus status; uint32_t delayedActionTime; @@ -5479,8 +5479,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ApplyUpdateRequestResponse::Id; } - static constexpr ClusterId GetClusterId() { return OtaSoftwareUpdateProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::ApplyUpdateRequestResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } OTAApplyUpdateAction action; uint32_t delayedActionTime; @@ -5491,8 +5491,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ApplyUpdateRequestResponse::Id; } - static constexpr ClusterId GetClusterId() { return OtaSoftwareUpdateProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::ApplyUpdateRequestResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateProvider::Id; } OTAApplyUpdateAction action; uint32_t delayedActionTime; @@ -5553,13 +5553,13 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AnnounceOtaProvider::Id; } - static constexpr ClusterId GetClusterId() { return OtaSoftwareUpdateRequestor::Id; } + static constexpr CommandId GetCommandId() { return Commands::AnnounceOtaProvider::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } chip::NodeId providerLocation; chip::VendorId vendorId; OTAAnnouncementReason announcementReason; - chip::ByteSpan metadataForNode; + Optional metadataForNode; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -5567,13 +5567,13 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AnnounceOtaProvider::Id; } - static constexpr ClusterId GetClusterId() { return OtaSoftwareUpdateRequestor::Id; } + static constexpr CommandId GetCommandId() { return Commands::AnnounceOtaProvider::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OtaSoftwareUpdateRequestor::Id; } chip::NodeId providerLocation; chip::VendorId vendorId; OTAAnnouncementReason announcementReason; - chip::ByteSpan metadataForNode; + Optional metadataForNode; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace AnnounceOtaProvider @@ -6019,8 +6019,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ArmFailSafe::Id; } - static constexpr ClusterId GetClusterId() { return GeneralCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::ArmFailSafe::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } uint16_t expiryLengthSeconds; uint64_t breadcrumb; @@ -6032,8 +6032,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ArmFailSafe::Id; } - static constexpr ClusterId GetClusterId() { return GeneralCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::ArmFailSafe::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } uint16_t expiryLengthSeconds; uint64_t breadcrumb; @@ -6052,8 +6052,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ArmFailSafeResponse::Id; } - static constexpr ClusterId GetClusterId() { return GeneralCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::ArmFailSafeResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } GeneralCommissioningError errorCode; chip::CharSpan debugText; @@ -6064,8 +6064,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ArmFailSafeResponse::Id; } - static constexpr ClusterId GetClusterId() { return GeneralCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::ArmFailSafeResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } GeneralCommissioningError errorCode; chip::CharSpan debugText; @@ -6085,8 +6085,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetRegulatoryConfig::Id; } - static constexpr ClusterId GetClusterId() { return GeneralCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetRegulatoryConfig::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } RegulatoryLocationType location; chip::CharSpan countryCode; @@ -6099,8 +6099,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetRegulatoryConfig::Id; } - static constexpr ClusterId GetClusterId() { return GeneralCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetRegulatoryConfig::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } RegulatoryLocationType location; chip::CharSpan countryCode; @@ -6120,8 +6120,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetRegulatoryConfigResponse::Id; } - static constexpr ClusterId GetClusterId() { return GeneralCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetRegulatoryConfigResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } GeneralCommissioningError errorCode; chip::CharSpan debugText; @@ -6132,8 +6132,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetRegulatoryConfigResponse::Id; } - static constexpr ClusterId GetClusterId() { return GeneralCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetRegulatoryConfigResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } GeneralCommissioningError errorCode; chip::CharSpan debugText; @@ -6149,8 +6149,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return CommissioningComplete::Id; } - static constexpr ClusterId GetClusterId() { return GeneralCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::CommissioningComplete::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -6158,8 +6158,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return CommissioningComplete::Id; } - static constexpr ClusterId GetClusterId() { return GeneralCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::CommissioningComplete::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -6175,8 +6175,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return CommissioningCompleteResponse::Id; } - static constexpr ClusterId GetClusterId() { return GeneralCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::CommissioningCompleteResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } GeneralCommissioningError errorCode; chip::CharSpan debugText; @@ -6187,8 +6187,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return CommissioningCompleteResponse::Id; } - static constexpr ClusterId GetClusterId() { return GeneralCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::CommissioningCompleteResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } GeneralCommissioningError errorCode; chip::CharSpan debugText; @@ -6352,8 +6352,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ScanNetworks::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::ScanNetworks::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan ssid; uint64_t breadcrumb; @@ -6365,8 +6365,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ScanNetworks::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::ScanNetworks::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan ssid; uint64_t breadcrumb; @@ -6387,8 +6387,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ScanNetworksResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::ScanNetworksResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6401,8 +6401,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ScanNetworksResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::ScanNetworksResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6424,8 +6424,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AddWiFiNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddWiFiNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -6438,8 +6438,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AddWiFiNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddWiFiNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -6459,8 +6459,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AddWiFiNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddWiFiNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6471,8 +6471,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AddWiFiNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddWiFiNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6492,8 +6492,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return UpdateWiFiNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateWiFiNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -6506,8 +6506,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return UpdateWiFiNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateWiFiNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan ssid; chip::ByteSpan credentials; @@ -6527,8 +6527,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return UpdateWiFiNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateWiFiNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6539,8 +6539,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return UpdateWiFiNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateWiFiNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6559,8 +6559,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AddThreadNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddThreadNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -6572,8 +6572,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AddThreadNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddThreadNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -6592,8 +6592,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AddThreadNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddThreadNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6604,8 +6604,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AddThreadNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddThreadNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6624,8 +6624,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return UpdateThreadNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateThreadNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -6637,8 +6637,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return UpdateThreadNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateThreadNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan operationalDataset; uint64_t breadcrumb; @@ -6657,8 +6657,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return UpdateThreadNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateThreadNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6669,8 +6669,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return UpdateThreadNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateThreadNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6689,8 +6689,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RemoveNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan networkID; uint64_t breadcrumb; @@ -6702,8 +6702,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RemoveNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan networkID; uint64_t breadcrumb; @@ -6722,8 +6722,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RemoveNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6734,8 +6734,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RemoveNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6754,8 +6754,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnableNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnableNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan networkID; uint64_t breadcrumb; @@ -6767,8 +6767,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnableNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnableNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan networkID; uint64_t breadcrumb; @@ -6787,8 +6787,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnableNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnableNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6799,8 +6799,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnableNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnableNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6819,8 +6819,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return DisableNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::DisableNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan networkID; uint64_t breadcrumb; @@ -6832,8 +6832,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return DisableNetwork::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::DisableNetwork::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } chip::ByteSpan networkID; uint64_t breadcrumb; @@ -6852,8 +6852,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return DisableNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::DisableNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6864,8 +6864,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return DisableNetworkResponse::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::DisableNetworkResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint8_t errorCode; chip::CharSpan debugText; @@ -6882,8 +6882,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetLastNetworkCommissioningResult::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetLastNetworkCommissioningResult::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint32_t timeoutMs; @@ -6893,8 +6893,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetLastNetworkCommissioningResult::Id; } - static constexpr ClusterId GetClusterId() { return NetworkCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetLastNetworkCommissioningResult::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::NetworkCommissioning::Id; } uint32_t timeoutMs; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -6980,8 +6980,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RetrieveLogsRequest::Id; } - static constexpr ClusterId GetClusterId() { return DiagnosticLogs::Id; } + static constexpr CommandId GetCommandId() { return Commands::RetrieveLogsRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DiagnosticLogs::Id; } LogsIntent intent; LogsTransferProtocol requestedProtocol; @@ -6993,8 +6993,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RetrieveLogsRequest::Id; } - static constexpr ClusterId GetClusterId() { return DiagnosticLogs::Id; } + static constexpr CommandId GetCommandId() { return Commands::RetrieveLogsRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DiagnosticLogs::Id; } LogsIntent intent; LogsTransferProtocol requestedProtocol; @@ -7015,8 +7015,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RetrieveLogsResponse::Id; } - static constexpr ClusterId GetClusterId() { return DiagnosticLogs::Id; } + static constexpr CommandId GetCommandId() { return Commands::RetrieveLogsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DiagnosticLogs::Id; } LogsStatus status; chip::ByteSpan content; @@ -7029,8 +7029,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RetrieveLogsResponse::Id; } - static constexpr ClusterId GetClusterId() { return DiagnosticLogs::Id; } + static constexpr CommandId GetCommandId() { return Commands::RetrieveLogsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DiagnosticLogs::Id; } LogsStatus status; chip::ByteSpan content; @@ -7325,8 +7325,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ResetWatermarks::Id; } - static constexpr ClusterId GetClusterId() { return SoftwareDiagnostics::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetWatermarks::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SoftwareDiagnostics::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -7334,8 +7334,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ResetWatermarks::Id; } - static constexpr ClusterId GetClusterId() { return SoftwareDiagnostics::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetWatermarks::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SoftwareDiagnostics::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -7591,8 +7591,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ResetCounts::Id; } - static constexpr ClusterId GetClusterId() { return ThreadNetworkDiagnostics::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetCounts::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ThreadNetworkDiagnostics::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -7600,8 +7600,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ResetCounts::Id; } - static constexpr ClusterId GetClusterId() { return ThreadNetworkDiagnostics::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetCounts::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ThreadNetworkDiagnostics::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -8305,8 +8305,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ResetCounts::Id; } - static constexpr ClusterId GetClusterId() { return WiFiNetworkDiagnostics::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetCounts::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -8314,8 +8314,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ResetCounts::Id; } - static constexpr ClusterId GetClusterId() { return WiFiNetworkDiagnostics::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetCounts::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WiFiNetworkDiagnostics::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -8507,8 +8507,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ResetCounts::Id; } - static constexpr ClusterId GetClusterId() { return EthernetNetworkDiagnostics::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetCounts::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EthernetNetworkDiagnostics::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -8516,8 +8516,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ResetCounts::Id; } - static constexpr ClusterId GetClusterId() { return EthernetNetworkDiagnostics::Id; } + static constexpr CommandId GetCommandId() { return Commands::ResetCounts::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::EthernetNetworkDiagnostics::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -8649,8 +8649,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StartUp::Id; } - static constexpr ClusterId GetClusterId() { return BridgedDeviceBasic::Id; } + static constexpr CommandId GetCommandId() { return Commands::StartUp::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BridgedDeviceBasic::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -8658,8 +8658,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StartUp::Id; } - static constexpr ClusterId GetClusterId() { return BridgedDeviceBasic::Id; } + static constexpr CommandId GetCommandId() { return Commands::StartUp::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BridgedDeviceBasic::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -8673,8 +8673,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ShutDown::Id; } - static constexpr ClusterId GetClusterId() { return BridgedDeviceBasic::Id; } + static constexpr CommandId GetCommandId() { return Commands::ShutDown::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BridgedDeviceBasic::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -8682,8 +8682,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ShutDown::Id; } - static constexpr ClusterId GetClusterId() { return BridgedDeviceBasic::Id; } + static constexpr CommandId GetCommandId() { return Commands::ShutDown::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BridgedDeviceBasic::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -8697,8 +8697,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Leave::Id; } - static constexpr ClusterId GetClusterId() { return BridgedDeviceBasic::Id; } + static constexpr CommandId GetCommandId() { return Commands::Leave::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BridgedDeviceBasic::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -8706,8 +8706,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Leave::Id; } - static constexpr ClusterId GetClusterId() { return BridgedDeviceBasic::Id; } + static constexpr CommandId GetCommandId() { return Commands::Leave::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BridgedDeviceBasic::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -8721,8 +8721,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ReachableChanged::Id; } - static constexpr ClusterId GetClusterId() { return BridgedDeviceBasic::Id; } + static constexpr CommandId GetCommandId() { return Commands::ReachableChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BridgedDeviceBasic::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -8730,8 +8730,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ReachableChanged::Id; } - static constexpr ClusterId GetClusterId() { return BridgedDeviceBasic::Id; } + static constexpr CommandId GetCommandId() { return Commands::ReachableChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BridgedDeviceBasic::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -8987,8 +8987,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return OpenCommissioningWindow::Id; } - static constexpr ClusterId GetClusterId() { return AdministratorCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::OpenCommissioningWindow::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AdministratorCommissioning::Id; } uint16_t commissioningTimeout; chip::ByteSpan PAKEVerifier; @@ -9003,8 +9003,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return OpenCommissioningWindow::Id; } - static constexpr ClusterId GetClusterId() { return AdministratorCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::OpenCommissioningWindow::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AdministratorCommissioning::Id; } uint16_t commissioningTimeout; chip::ByteSpan PAKEVerifier; @@ -9025,8 +9025,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return OpenBasicCommissioningWindow::Id; } - static constexpr ClusterId GetClusterId() { return AdministratorCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::OpenBasicCommissioningWindow::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AdministratorCommissioning::Id; } uint16_t commissioningTimeout; @@ -9036,8 +9036,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return OpenBasicCommissioningWindow::Id; } - static constexpr ClusterId GetClusterId() { return AdministratorCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::OpenBasicCommissioningWindow::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AdministratorCommissioning::Id; } uint16_t commissioningTimeout; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -9052,8 +9052,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RevokeCommissioning::Id; } - static constexpr ClusterId GetClusterId() { return AdministratorCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::RevokeCommissioning::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AdministratorCommissioning::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -9061,8 +9061,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RevokeCommissioning::Id; } - static constexpr ClusterId GetClusterId() { return AdministratorCommissioning::Id; } + static constexpr CommandId GetCommandId() { return Commands::RevokeCommissioning::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AdministratorCommissioning::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -9176,8 +9176,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AttestationRequest::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::AttestationRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan attestationNonce; @@ -9187,8 +9187,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AttestationRequest::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::AttestationRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan attestationNonce; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -9205,8 +9205,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AttestationResponse::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::AttestationResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan attestationElements; chip::ByteSpan signature; @@ -9217,8 +9217,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AttestationResponse::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::AttestationResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan attestationElements; chip::ByteSpan signature; @@ -9235,8 +9235,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return CertificateChainRequest::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::CertificateChainRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } uint8_t certificateType; @@ -9246,8 +9246,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return CertificateChainRequest::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::CertificateChainRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } uint8_t certificateType; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -9263,8 +9263,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return CertificateChainResponse::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::CertificateChainResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan certificate; @@ -9274,8 +9274,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return CertificateChainResponse::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::CertificateChainResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan certificate; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -9291,8 +9291,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return OpCSRRequest::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::OpCSRRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan CSRNonce; @@ -9302,8 +9302,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return OpCSRRequest::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::OpCSRRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan CSRNonce; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -9320,8 +9320,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return OpCSRResponse::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::OpCSRResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan NOCSRElements; chip::ByteSpan attestationSignature; @@ -9332,8 +9332,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return OpCSRResponse::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::OpCSRResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan NOCSRElements; chip::ByteSpan attestationSignature; @@ -9354,11 +9354,11 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AddNOC::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddNOC::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan NOCValue; - chip::ByteSpan ICACValue; + Optional ICACValue; chip::ByteSpan IPKValue; chip::NodeId caseAdminNode; uint16_t adminVendorId; @@ -9369,11 +9369,11 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AddNOC::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddNOC::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan NOCValue; - chip::ByteSpan ICACValue; + Optional ICACValue; chip::ByteSpan IPKValue; chip::NodeId caseAdminNode; uint16_t adminVendorId; @@ -9391,11 +9391,11 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return UpdateNOC::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateNOC::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan NOCValue; - chip::ByteSpan ICACValue; + Optional ICACValue; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -9403,11 +9403,11 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return UpdateNOC::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateNOC::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan NOCValue; - chip::ByteSpan ICACValue; + Optional ICACValue; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace UpdateNOC @@ -9423,8 +9423,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return NOCResponse::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::NOCResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } uint8_t statusCode; uint8_t fabricIndex; @@ -9436,8 +9436,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return NOCResponse::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::NOCResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } uint8_t statusCode; uint8_t fabricIndex; @@ -9455,8 +9455,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return UpdateFabricLabel::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateFabricLabel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::CharSpan label; @@ -9466,8 +9466,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return UpdateFabricLabel::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateFabricLabel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::CharSpan label; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -9483,8 +9483,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RemoveFabric::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveFabric::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } uint8_t fabricIndex; @@ -9494,8 +9494,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RemoveFabric::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveFabric::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } uint8_t fabricIndex; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -9511,8 +9511,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AddTrustedRootCertificate::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddTrustedRootCertificate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan rootCertificate; @@ -9522,8 +9522,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AddTrustedRootCertificate::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::AddTrustedRootCertificate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan rootCertificate; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -9539,8 +9539,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RemoveTrustedRootCertificate::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveTrustedRootCertificate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan trustedRootIdentifier; @@ -9550,8 +9550,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RemoveTrustedRootCertificate::Id; } - static constexpr ClusterId GetClusterId() { return OperationalCredentials::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveTrustedRootCertificate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; } chip::ByteSpan trustedRootIdentifier; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -9729,7 +9729,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x00000000; - static constexpr ClusterId GetClusterId() { return BooleanState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BooleanState::Id; } bool stateValue; @@ -9741,7 +9741,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return BooleanState::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BooleanState::Id; } bool stateValue; @@ -9936,8 +9936,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return LockDoor::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::LockDoor::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } chip::ByteSpan pin; @@ -9947,8 +9947,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return LockDoor::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::LockDoor::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } chip::ByteSpan pin; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -9964,8 +9964,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return LockDoorResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::LockDoorResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -9975,8 +9975,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return LockDoorResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::LockDoorResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -9992,8 +9992,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return UnlockDoor::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::UnlockDoor::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } chip::ByteSpan pin; @@ -10003,8 +10003,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return UnlockDoor::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::UnlockDoor::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } chip::ByteSpan pin; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10020,8 +10020,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return UnlockDoorResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::UnlockDoorResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -10031,8 +10031,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return UnlockDoorResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::UnlockDoorResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10048,8 +10048,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Toggle::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::Toggle::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } chip::CharSpan pin; @@ -10059,8 +10059,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Toggle::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::Toggle::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } chip::CharSpan pin; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10076,8 +10076,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ToggleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ToggleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -10087,8 +10087,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ToggleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ToggleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10105,8 +10105,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return UnlockWithTimeout::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::UnlockWithTimeout::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t timeoutInSeconds; chip::ByteSpan pin; @@ -10117,8 +10117,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return UnlockWithTimeout::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::UnlockWithTimeout::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t timeoutInSeconds; chip::ByteSpan pin; @@ -10135,8 +10135,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return UnlockWithTimeoutResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::UnlockWithTimeoutResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -10146,8 +10146,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return UnlockWithTimeoutResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::UnlockWithTimeoutResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10163,8 +10163,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetLogRecord::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetLogRecord::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t logIndex; @@ -10174,8 +10174,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetLogRecord::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetLogRecord::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t logIndex; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10197,8 +10197,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetLogRecordResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetLogRecordResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t logEntryId; uint32_t timestamp; @@ -10214,8 +10214,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetLogRecordResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetLogRecordResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t logEntryId; uint32_t timestamp; @@ -10240,8 +10240,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetPin::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetPin::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; DoorLockUserStatus userStatus; @@ -10254,8 +10254,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetPin::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetPin::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; DoorLockUserStatus userStatus; @@ -10274,8 +10274,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetPinResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetPinResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DoorLockSetPinOrIdStatus status; @@ -10285,8 +10285,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetPinResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetPinResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DoorLockSetPinOrIdStatus status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10302,8 +10302,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetPin::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPin::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; @@ -10313,8 +10313,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetPin::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPin::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10333,8 +10333,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetPinResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPinResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; DoorLockUserStatus userStatus; @@ -10347,8 +10347,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetPinResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPinResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; DoorLockUserStatus userStatus; @@ -10367,8 +10367,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearPin::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearPin::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; @@ -10378,8 +10378,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearPin::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearPin::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10395,8 +10395,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearPinResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearPinResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -10406,8 +10406,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearPinResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearPinResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10422,8 +10422,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearAllPins::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearAllPins::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -10431,8 +10431,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearAllPins::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearAllPins::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -10447,8 +10447,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearAllPinsResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearAllPinsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -10458,8 +10458,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearAllPinsResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearAllPinsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10476,8 +10476,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetUserStatus::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetUserStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; uint8_t userStatus; @@ -10488,8 +10488,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetUserStatus::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetUserStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; uint8_t userStatus; @@ -10506,8 +10506,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetUserStatusResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetUserStatusResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -10517,8 +10517,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetUserStatusResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetUserStatusResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10534,8 +10534,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetUserStatus::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetUserStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; @@ -10545,8 +10545,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetUserStatus::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetUserStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10563,8 +10563,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetUserStatusResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetUserStatusResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; uint8_t status; @@ -10575,8 +10575,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetUserStatusResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetUserStatusResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; uint8_t status; @@ -10599,8 +10599,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetWeekdaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetWeekdaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10616,8 +10616,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetWeekdaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetWeekdaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10639,8 +10639,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetWeekdayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetWeekdayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -10650,8 +10650,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetWeekdayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetWeekdayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10668,8 +10668,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetWeekdaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetWeekdaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10680,8 +10680,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetWeekdaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetWeekdaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10705,8 +10705,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetWeekdayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetWeekdayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10723,8 +10723,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetWeekdayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetWeekdayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10748,8 +10748,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearWeekdaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearWeekdaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10760,8 +10760,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearWeekdaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearWeekdaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10778,8 +10778,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearWeekdayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearWeekdayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -10789,8 +10789,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearWeekdayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearWeekdayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10809,8 +10809,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetYeardaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetYeardaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10823,8 +10823,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetYeardaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetYeardaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10843,8 +10843,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetYeardayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetYeardayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -10854,8 +10854,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetYeardayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetYeardayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -10872,8 +10872,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetYeardaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetYeardaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10884,8 +10884,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetYeardaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetYeardaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10906,8 +10906,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetYeardayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetYeardayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10921,8 +10921,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetYeardayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetYeardayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10943,8 +10943,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearYeardaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearYeardaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10955,8 +10955,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearYeardaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearYeardaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint16_t userId; @@ -10973,8 +10973,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearYeardayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearYeardayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -10984,8 +10984,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearYeardayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearYeardayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11004,8 +11004,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetHolidaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetHolidaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint32_t localStartTime; @@ -11018,8 +11018,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetHolidaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetHolidaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint32_t localStartTime; @@ -11038,8 +11038,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetHolidayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetHolidayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -11049,8 +11049,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetHolidayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetHolidayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11066,8 +11066,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetHolidaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetHolidaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; @@ -11077,8 +11077,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetHolidaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetHolidaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11098,8 +11098,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetHolidayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetHolidayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint8_t status; @@ -11113,8 +11113,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetHolidayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetHolidayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; uint8_t status; @@ -11134,8 +11134,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearHolidaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearHolidaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; @@ -11145,8 +11145,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearHolidaySchedule::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearHolidaySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t scheduleId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11162,8 +11162,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearHolidayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearHolidayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -11173,8 +11173,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearHolidayScheduleResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearHolidayScheduleResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11191,8 +11191,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetUserType::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetUserType::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; DoorLockUserType userType; @@ -11203,8 +11203,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetUserType::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetUserType::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; DoorLockUserType userType; @@ -11221,8 +11221,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetUserTypeResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetUserTypeResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -11232,8 +11232,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetUserTypeResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetUserTypeResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11249,8 +11249,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetUserType::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetUserType::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; @@ -11260,8 +11260,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetUserType::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetUserType::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11278,8 +11278,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetUserTypeResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetUserTypeResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; DoorLockUserType userType; @@ -11290,8 +11290,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetUserTypeResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetUserTypeResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; DoorLockUserType userType; @@ -11311,8 +11311,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetRfid::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetRfid::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; DoorLockUserStatus userStatus; @@ -11325,8 +11325,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetRfid::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetRfid::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; DoorLockUserStatus userStatus; @@ -11345,8 +11345,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetRfidResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetRfidResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DoorLockSetPinOrIdStatus status; @@ -11356,8 +11356,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetRfidResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetRfidResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } DoorLockSetPinOrIdStatus status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11373,8 +11373,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetRfid::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetRfid::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; @@ -11384,8 +11384,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetRfid::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetRfid::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11404,8 +11404,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetRfidResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetRfidResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; DoorLockUserStatus userStatus; @@ -11418,8 +11418,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetRfidResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetRfidResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; DoorLockUserStatus userStatus; @@ -11438,8 +11438,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearRfid::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearRfid::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; @@ -11449,8 +11449,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearRfid::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearRfid::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint16_t userId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11466,8 +11466,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearRfidResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearRfidResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -11477,8 +11477,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearRfidResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearRfidResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11493,8 +11493,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearAllRfids::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearAllRfids::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -11502,8 +11502,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearAllRfids::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearAllRfids::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -11518,8 +11518,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearAllRfidsResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearAllRfidsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; @@ -11529,8 +11529,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearAllRfidsResponse::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearAllRfidsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -11551,8 +11551,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return OperationEventNotification::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::OperationEventNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t source; DoorLockOperationEventCode eventCode; @@ -11567,8 +11567,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return OperationEventNotification::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::OperationEventNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t source; DoorLockOperationEventCode eventCode; @@ -11596,8 +11596,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ProgrammingEventNotification::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ProgrammingEventNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t source; DoorLockProgrammingEventCode eventCode; @@ -11614,8 +11614,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ProgrammingEventNotification::Id; } - static constexpr ClusterId GetClusterId() { return DoorLock::Id; } + static constexpr CommandId GetCommandId() { return Commands::ProgrammingEventNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } uint8_t source; DoorLockProgrammingEventCode eventCode; @@ -12084,62 +12084,6 @@ struct TypeInfo } // namespace Attributes } // namespace DoorLock namespace WindowCovering { -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Enum for WcEndProductType -enum class WcEndProductType : uint8_t -{ - kRollerShade = 0x00, - kRomanShade = 0x01, - kBalloonShade = 0x02, - kWovenWood = 0x03, - kPleatedShade = 0x04, - kCellularShade = 0x05, - kLayeredShade = 0x06, - kLayeredShade2D = 0x07, - kSheerShade = 0x08, - kTiltOnlyInteriorBlind = 0x09, - kInteriorBlind = 0x0A, - kVerticalBlindStripCurtain = 0x0B, - kInteriorVenetianBlind = 0x0C, - kExteriorVenetianBlind = 0x0D, - kLateralLeftCurtain = 0x0E, - kLateralRightCurtain = 0x0F, - kCentralCurtain = 0x10, - kRollerShutter = 0x11, - kExteriorVerticalScreen = 0x12, - kAwningTerracePatio = 0x13, - kAwningVerticalScreen = 0x14, - kTiltOnlyPergola = 0x15, - kSwingingShutter = 0x16, - kSlidingShutter = 0x17, - kUnknown = 0xFF, -}; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using WcEndProductType = EmberAfWcEndProductType; -#endif -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -// Enum for WcType -enum class WcType : uint8_t -{ - kRollershade = 0x00, - kRollershade2Motor = 0x01, - kRollershadeExterior = 0x02, - kRollershadeExterior2Motor = 0x03, - kDrapery = 0x04, - kAwning = 0x05, - kShutter = 0x06, - kTiltBlindTiltOnly = 0x07, - kTiltBlindLiftAndTilt = 0x08, - kProjectorScreen = 0x09, - kUnknown = 0xFF, -}; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using WcType = EmberAfWcType; -#endif // Bitmap for WcConfigStatus enum class WcConfigStatus : uint8_t @@ -12197,8 +12141,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return UpOrOpen::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpOrOpen::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -12206,8 +12150,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return UpOrOpen::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpOrOpen::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -12221,8 +12165,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return DownOrClose::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::DownOrClose::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -12230,8 +12174,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return DownOrClose::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::DownOrClose::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -12245,8 +12189,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StopMotion::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::StopMotion::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -12254,8 +12198,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StopMotion::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::StopMotion::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -12270,8 +12214,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GoToLiftValue::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::GoToLiftValue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } uint16_t liftValue; @@ -12281,8 +12225,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GoToLiftValue::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::GoToLiftValue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } uint16_t liftValue; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -12299,8 +12243,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GoToLiftPercentage::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::GoToLiftPercentage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } uint8_t liftPercentageValue; uint16_t liftPercent100thsValue; @@ -12311,8 +12255,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GoToLiftPercentage::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::GoToLiftPercentage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } uint8_t liftPercentageValue; uint16_t liftPercent100thsValue; @@ -12329,8 +12273,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GoToTiltValue::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::GoToTiltValue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } uint16_t tiltValue; @@ -12340,8 +12284,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GoToTiltValue::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::GoToTiltValue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } uint16_t tiltValue; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -12358,8 +12302,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GoToTiltPercentage::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::GoToTiltPercentage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } uint8_t tiltPercentageValue; uint16_t tiltPercent100thsValue; @@ -12370,8 +12314,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GoToTiltPercentage::Id; } - static constexpr ClusterId GetClusterId() { return WindowCovering::Id; } + static constexpr CommandId GetCommandId() { return Commands::GoToTiltPercentage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } uint8_t tiltPercentageValue; uint16_t tiltPercent100thsValue; @@ -12686,8 +12630,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return BarrierControlGoToPercent::Id; } - static constexpr ClusterId GetClusterId() { return BarrierControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::BarrierControlGoToPercent::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } uint8_t percentOpen; @@ -12697,8 +12641,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return BarrierControlGoToPercent::Id; } - static constexpr ClusterId GetClusterId() { return BarrierControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::BarrierControlGoToPercent::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } uint8_t percentOpen; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -12713,8 +12657,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return BarrierControlStop::Id; } - static constexpr ClusterId GetClusterId() { return BarrierControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::BarrierControlStop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -12722,8 +12666,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return BarrierControlStop::Id; } - static constexpr ClusterId GetClusterId() { return BarrierControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::BarrierControlStop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13175,7 +13119,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x00000000; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13185,7 +13129,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13203,7 +13147,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x00000001; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13213,7 +13157,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13231,7 +13175,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x00000002; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13241,7 +13185,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13259,7 +13203,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x00000003; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13269,7 +13213,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13287,7 +13231,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x00000004; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13297,7 +13241,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13315,7 +13259,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Critical; static constexpr EventId eventId = 0x00000005; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13325,7 +13269,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13343,7 +13287,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x00000006; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13353,7 +13297,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13371,7 +13315,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Critical; static constexpr EventId eventId = 0x00000007; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13381,7 +13325,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13399,7 +13343,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x00000008; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13409,7 +13353,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13427,7 +13371,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Critical; static constexpr EventId eventId = 0x00000009; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13437,7 +13381,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13455,7 +13399,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x0000000A; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13465,7 +13409,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13483,7 +13427,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x0000000B; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13493,7 +13437,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13511,7 +13455,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Critical; static constexpr EventId eventId = 0x0000000C; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13521,7 +13465,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13539,7 +13483,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x0000000D; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13549,7 +13493,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13567,7 +13511,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x0000000E; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13577,7 +13521,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13595,7 +13539,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x0000000F; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13605,7 +13549,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13623,7 +13567,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x00000010; - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13633,7 +13577,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return PumpConfigurationAndControl::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13687,8 +13631,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetpointRaiseLower::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetpointRaiseLower::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } SetpointAdjustMode mode; int8_t amount; @@ -13699,8 +13643,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetpointRaiseLower::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetpointRaiseLower::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } SetpointAdjustMode mode; int8_t amount; @@ -13720,8 +13664,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return CurrentWeeklySchedule::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::CurrentWeeklySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } uint8_t numberOfTransitionsForSequence; chip::BitFlags dayOfWeekForSequence; @@ -13734,8 +13678,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return CurrentWeeklySchedule::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::CurrentWeeklySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } uint8_t numberOfTransitionsForSequence; chip::BitFlags dayOfWeekForSequence; @@ -13757,8 +13701,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetWeeklySchedule::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetWeeklySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } uint8_t numberOfTransitionsForSequence; chip::BitFlags dayOfWeekForSequence; @@ -13771,8 +13715,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetWeeklySchedule::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetWeeklySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } uint8_t numberOfTransitionsForSequence; chip::BitFlags dayOfWeekForSequence; @@ -13796,8 +13740,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RelayStatusLog::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::RelayStatusLog::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } uint16_t timeOfDay; uint16_t relayStatus; @@ -13812,8 +13756,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RelayStatusLog::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::RelayStatusLog::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } uint16_t timeOfDay; uint16_t relayStatus; @@ -13835,8 +13779,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetWeeklySchedule::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetWeeklySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } chip::BitFlags daysToReturn; chip::BitFlags modeToReturn; @@ -13847,8 +13791,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetWeeklySchedule::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetWeeklySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } chip::BitFlags daysToReturn; chip::BitFlags modeToReturn; @@ -13864,8 +13808,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ClearWeeklySchedule::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearWeeklySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13873,8 +13817,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ClearWeeklySchedule::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::ClearWeeklySchedule::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -13888,8 +13832,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetRelayStatusLog::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetRelayStatusLog::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -13897,8 +13841,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetRelayStatusLog::Id; } - static constexpr ClusterId GetClusterId() { return Thermostat::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetRelayStatusLog::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -14701,8 +14645,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MoveToHue::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToHue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint8_t hue; HueDirection direction; @@ -14716,8 +14660,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MoveToHue::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToHue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint8_t hue; HueDirection direction; @@ -14740,8 +14684,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MoveHue::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveHue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } HueMoveMode moveMode; uint8_t rate; @@ -14754,8 +14698,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MoveHue::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveHue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } HueMoveMode moveMode; uint8_t rate; @@ -14778,8 +14722,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StepHue::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StepHue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } HueStepMode stepMode; uint8_t stepSize; @@ -14793,8 +14737,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StepHue::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StepHue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } HueStepMode stepMode; uint8_t stepSize; @@ -14817,8 +14761,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MoveToSaturation::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToSaturation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint8_t saturation; uint16_t transitionTime; @@ -14831,8 +14775,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MoveToSaturation::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToSaturation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint8_t saturation; uint16_t transitionTime; @@ -14854,8 +14798,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MoveSaturation::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveSaturation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } SaturationMoveMode moveMode; uint8_t rate; @@ -14868,8 +14812,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MoveSaturation::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveSaturation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } SaturationMoveMode moveMode; uint8_t rate; @@ -14892,8 +14836,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StepSaturation::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StepSaturation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } SaturationStepMode stepMode; uint8_t stepSize; @@ -14907,8 +14851,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StepSaturation::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StepSaturation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } SaturationStepMode stepMode; uint8_t stepSize; @@ -14932,8 +14876,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MoveToHueAndSaturation::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToHueAndSaturation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint8_t hue; uint8_t saturation; @@ -14947,8 +14891,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MoveToHueAndSaturation::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToHueAndSaturation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint8_t hue; uint8_t saturation; @@ -14972,8 +14916,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MoveToColor::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToColor::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint16_t colorX; uint16_t colorY; @@ -14987,8 +14931,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MoveToColor::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToColor::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint16_t colorX; uint16_t colorY; @@ -15011,8 +14955,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MoveColor::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveColor::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } int16_t rateX; int16_t rateY; @@ -15025,8 +14969,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MoveColor::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveColor::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } int16_t rateX; int16_t rateY; @@ -15049,8 +14993,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StepColor::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StepColor::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } int16_t stepX; int16_t stepY; @@ -15064,8 +15008,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StepColor::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StepColor::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } int16_t stepX; int16_t stepY; @@ -15088,8 +15032,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MoveToColorTemperature::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToColorTemperature::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint16_t colorTemperature; uint16_t transitionTime; @@ -15102,8 +15046,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MoveToColorTemperature::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveToColorTemperature::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint16_t colorTemperature; uint16_t transitionTime; @@ -15126,8 +15070,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnhancedMoveToHue::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedMoveToHue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint16_t enhancedHue; HueDirection direction; @@ -15141,8 +15085,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnhancedMoveToHue::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedMoveToHue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint16_t enhancedHue; HueDirection direction; @@ -15165,8 +15109,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnhancedMoveHue::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedMoveHue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } HueMoveMode moveMode; uint16_t rate; @@ -15179,8 +15123,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnhancedMoveHue::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedMoveHue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } HueMoveMode moveMode; uint16_t rate; @@ -15203,8 +15147,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnhancedStepHue::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedStepHue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } HueStepMode stepMode; uint16_t stepSize; @@ -15218,8 +15162,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnhancedStepHue::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedStepHue::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } HueStepMode stepMode; uint16_t stepSize; @@ -15243,8 +15187,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EnhancedMoveToHueAndSaturation::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedMoveToHueAndSaturation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint16_t enhancedHue; uint8_t saturation; @@ -15258,8 +15202,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EnhancedMoveToHueAndSaturation::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::EnhancedMoveToHueAndSaturation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint16_t enhancedHue; uint8_t saturation; @@ -15285,8 +15229,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ColorLoopSet::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::ColorLoopSet::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } chip::BitFlags updateFlags; ColorLoopAction action; @@ -15302,8 +15246,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ColorLoopSet::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::ColorLoopSet::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } chip::BitFlags updateFlags; ColorLoopAction action; @@ -15326,8 +15270,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StopMoveStep::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StopMoveStep::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint8_t optionsMask; uint8_t optionsOverride; @@ -15338,8 +15282,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StopMoveStep::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StopMoveStep::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } uint8_t optionsMask; uint8_t optionsOverride; @@ -15361,8 +15305,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MoveColorTemperature::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveColorTemperature::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } HueMoveMode moveMode; uint16_t rate; @@ -15377,8 +15321,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MoveColorTemperature::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::MoveColorTemperature::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } HueMoveMode moveMode; uint16_t rate; @@ -15405,8 +15349,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StepColorTemperature::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StepColorTemperature::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } HueStepMode stepMode; uint16_t stepSize; @@ -15422,8 +15366,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StepColorTemperature::Id; } - static constexpr ClusterId GetClusterId() { return ColorControl::Id; } + static constexpr CommandId GetCommandId() { return Commands::StepColorTemperature::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } HueStepMode stepMode; uint16_t stepSize; @@ -16183,8 +16127,8 @@ namespace Attributes { namespace MeasuredValue { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::MeasuredValue::Id; } @@ -16193,8 +16137,8 @@ struct TypeInfo namespace MinMeasuredValue { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::MinMeasuredValue::Id; } @@ -16203,8 +16147,8 @@ struct TypeInfo namespace MaxMeasuredValue { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::MaxMeasuredValue::Id; } @@ -16223,8 +16167,8 @@ struct TypeInfo namespace LightSensorType { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; + using Type = DataModel::Nullable; + using DecodableType = DataModel::Nullable; static constexpr ClusterId GetClusterId() { return Clusters::IlluminanceMeasurement::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LightSensorType::Id; } @@ -18726,8 +18670,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ZoneEnrollResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::ZoneEnrollResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } IasEnrollResponseCode enrollResponseCode; uint8_t zoneId; @@ -18738,8 +18682,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ZoneEnrollResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::ZoneEnrollResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } IasEnrollResponseCode enrollResponseCode; uint8_t zoneId; @@ -18759,8 +18703,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ZoneStatusChangeNotification::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::ZoneStatusChangeNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } chip::BitFlags zoneStatus; uint8_t extendedStatus; @@ -18773,8 +18717,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ZoneStatusChangeNotification::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::ZoneStatusChangeNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } chip::BitFlags zoneStatus; uint8_t extendedStatus; @@ -18792,8 +18736,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return InitiateNormalOperationMode::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::InitiateNormalOperationMode::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -18801,8 +18745,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return InitiateNormalOperationMode::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::InitiateNormalOperationMode::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -18818,8 +18762,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ZoneEnrollRequest::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::ZoneEnrollRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } IasZoneType zoneType; uint16_t manufacturerCode; @@ -18830,8 +18774,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ZoneEnrollRequest::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::ZoneEnrollRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } IasZoneType zoneType; uint16_t manufacturerCode; @@ -18849,8 +18793,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return InitiateTestMode::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::InitiateTestMode::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } uint8_t testModeDuration; uint8_t currentZoneSensitivityLevel; @@ -18861,8 +18805,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return InitiateTestMode::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::InitiateTestMode::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } uint8_t testModeDuration; uint8_t currentZoneSensitivityLevel; @@ -18878,8 +18822,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return InitiateNormalOperationModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::InitiateNormalOperationModeResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -18887,8 +18831,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return InitiateNormalOperationModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::InitiateNormalOperationModeResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -18902,8 +18846,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return InitiateTestModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::InitiateTestModeResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -18911,8 +18855,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return InitiateTestModeResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasZone::Id; } + static constexpr CommandId GetCommandId() { return Commands::InitiateTestModeResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -19188,8 +19132,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Arm::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::Arm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } IasAceArmMode armMode; chip::CharSpan armDisarmCode; @@ -19201,8 +19145,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Arm::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::Arm::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } IasAceArmMode armMode; chip::CharSpan armDisarmCode; @@ -19220,8 +19164,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ArmResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::ArmResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } IasAceArmNotification armNotification; @@ -19231,8 +19175,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ArmResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::ArmResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } IasAceArmNotification armNotification; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -19250,8 +19194,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Bypass::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::Bypass::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t numberOfZones; DataModel::List zoneIds; @@ -19263,8 +19207,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Bypass::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::Bypass::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t numberOfZones; DataModel::DecodableList zoneIds; @@ -19297,8 +19241,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetZoneIdMapResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetZoneIdMapResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint16_t section0; uint16_t section1; @@ -19323,8 +19267,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetZoneIdMapResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetZoneIdMapResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint16_t section0; uint16_t section1; @@ -19354,8 +19298,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Emergency::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::Emergency::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -19363,8 +19307,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Emergency::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::Emergency::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -19382,8 +19326,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetZoneInformationResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetZoneInformationResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t zoneId; IasZoneType zoneType; @@ -19396,8 +19340,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetZoneInformationResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetZoneInformationResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t zoneId; IasZoneType zoneType; @@ -19415,8 +19359,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Fire::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::Fire::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -19424,8 +19368,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Fire::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::Fire::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -19443,8 +19387,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ZoneStatusChanged::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::ZoneStatusChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t zoneId; uint16_t zoneStatus; @@ -19457,8 +19401,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ZoneStatusChanged::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::ZoneStatusChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t zoneId; uint16_t zoneStatus; @@ -19476,8 +19420,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Panic::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::Panic::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -19485,8 +19429,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Panic::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::Panic::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -19504,8 +19448,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return PanelStatusChanged::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::PanelStatusChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } IasAcePanelStatus panelStatus; uint8_t secondsRemaining; @@ -19518,8 +19462,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return PanelStatusChanged::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::PanelStatusChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } IasAcePanelStatus panelStatus; uint8_t secondsRemaining; @@ -19537,8 +19481,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetZoneIdMap::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetZoneIdMap::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -19546,8 +19490,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetZoneIdMap::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetZoneIdMap::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -19565,8 +19509,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetPanelStatusResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPanelStatusResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } IasAcePanelStatus panelStatus; uint8_t secondsRemaining; @@ -19579,8 +19523,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetPanelStatusResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPanelStatusResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } IasAcePanelStatus panelStatus; uint8_t secondsRemaining; @@ -19599,8 +19543,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetZoneInformation::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetZoneInformation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t zoneId; @@ -19610,8 +19554,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetZoneInformation::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetZoneInformation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t zoneId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -19628,8 +19572,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SetBypassedZoneList::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetBypassedZoneList::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t numberOfZones; DataModel::List zoneIds; @@ -19640,8 +19584,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SetBypassedZoneList::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::SetBypassedZoneList::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t numberOfZones; DataModel::DecodableList zoneIds; @@ -19657,8 +19601,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetPanelStatus::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPanelStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -19666,8 +19610,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetPanelStatus::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetPanelStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -19683,8 +19627,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return BypassResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::BypassResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t numberOfZones; DataModel::List bypassResult; @@ -19695,8 +19639,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return BypassResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::BypassResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t numberOfZones; DataModel::DecodableList bypassResult; @@ -19712,8 +19656,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetBypassedZoneList::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetBypassedZoneList::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -19721,8 +19665,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetBypassedZoneList::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetBypassedZoneList::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -19739,8 +19683,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetZoneStatusResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetZoneStatusResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } bool zoneStatusComplete; uint8_t numberOfZones; @@ -19752,8 +19696,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetZoneStatusResponse::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetZoneStatusResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } bool zoneStatusComplete; uint8_t numberOfZones; @@ -19774,8 +19718,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetZoneStatus::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetZoneStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t startingZoneId; uint8_t maxNumberOfZoneIds; @@ -19788,8 +19732,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetZoneStatus::Id; } - static constexpr ClusterId GetClusterId() { return IasAce::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetZoneStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasAce::Id; } uint8_t startingZoneId; uint8_t maxNumberOfZoneIds; @@ -19855,8 +19799,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StartWarning::Id; } - static constexpr ClusterId GetClusterId() { return IasWd::Id; } + static constexpr CommandId GetCommandId() { return Commands::StartWarning::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasWd::Id; } chip::BitFlags warningInfo; uint16_t warningDuration; @@ -19869,8 +19813,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StartWarning::Id; } - static constexpr ClusterId GetClusterId() { return IasWd::Id; } + static constexpr CommandId GetCommandId() { return Commands::StartWarning::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasWd::Id; } chip::BitFlags warningInfo; uint16_t warningDuration; @@ -19889,8 +19833,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Squawk::Id; } - static constexpr ClusterId GetClusterId() { return IasWd::Id; } + static constexpr CommandId GetCommandId() { return Commands::Squawk::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasWd::Id; } chip::BitFlags squawkInfo; @@ -19900,8 +19844,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Squawk::Id; } - static constexpr ClusterId GetClusterId() { return IasWd::Id; } + static constexpr CommandId GetCommandId() { return Commands::Squawk::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::IasWd::Id; } chip::BitFlags squawkInfo; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20066,8 +20010,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ChangeChannel::Id; } - static constexpr ClusterId GetClusterId() { return TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeChannel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } chip::CharSpan match; @@ -20077,8 +20021,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ChangeChannel::Id; } - static constexpr ClusterId GetClusterId() { return TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeChannel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } chip::CharSpan match; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20095,8 +20039,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ChangeChannelResponse::Id; } - static constexpr ClusterId GetClusterId() { return TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeChannelResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } DataModel::List channelMatch; TvChannelErrorType errorType; @@ -20107,8 +20051,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ChangeChannelResponse::Id; } - static constexpr ClusterId GetClusterId() { return TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeChannelResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } DataModel::DecodableList channelMatch; TvChannelErrorType errorType; @@ -20126,8 +20070,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ChangeChannelByNumber::Id; } - static constexpr ClusterId GetClusterId() { return TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeChannelByNumber::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } uint16_t majorNumber; uint16_t minorNumber; @@ -20138,8 +20082,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ChangeChannelByNumber::Id; } - static constexpr ClusterId GetClusterId() { return TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeChannelByNumber::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } uint16_t majorNumber; uint16_t minorNumber; @@ -20156,8 +20100,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SkipChannel::Id; } - static constexpr ClusterId GetClusterId() { return TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::SkipChannel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } uint16_t count; @@ -20167,8 +20111,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SkipChannel::Id; } - static constexpr ClusterId GetClusterId() { return TvChannel::Id; } + static constexpr CommandId GetCommandId() { return Commands::SkipChannel::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TvChannel::Id; } uint16_t count; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20279,8 +20223,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return NavigateTarget::Id; } - static constexpr ClusterId GetClusterId() { return TargetNavigator::Id; } + static constexpr CommandId GetCommandId() { return Commands::NavigateTarget::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } uint8_t target; chip::CharSpan data; @@ -20291,8 +20235,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return NavigateTarget::Id; } - static constexpr ClusterId GetClusterId() { return TargetNavigator::Id; } + static constexpr CommandId GetCommandId() { return Commands::NavigateTarget::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } uint8_t target; chip::CharSpan data; @@ -20310,8 +20254,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return NavigateTargetResponse::Id; } - static constexpr ClusterId GetClusterId() { return TargetNavigator::Id; } + static constexpr CommandId GetCommandId() { return Commands::NavigateTargetResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } NavigateTargetStatus status; chip::CharSpan data; @@ -20322,8 +20266,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return NavigateTargetResponse::Id; } - static constexpr ClusterId GetClusterId() { return TargetNavigator::Id; } + static constexpr CommandId GetCommandId() { return Commands::NavigateTargetResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TargetNavigator::Id; } NavigateTargetStatus status; chip::CharSpan data; @@ -20440,8 +20384,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaPlay::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaPlay::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -20449,8 +20393,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaPlay::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaPlay::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -20465,8 +20409,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaPlayResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaPlayResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; @@ -20476,8 +20420,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaPlayResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaPlayResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20492,8 +20436,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaPause::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaPause::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -20501,8 +20445,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaPause::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaPause::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -20517,8 +20461,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaPauseResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaPauseResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; @@ -20528,8 +20472,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaPauseResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaPauseResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20544,8 +20488,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaStop::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaStop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -20553,8 +20497,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaStop::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaStop::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -20569,8 +20513,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaStopResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaStopResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; @@ -20580,8 +20524,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaStopResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaStopResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20596,8 +20540,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaStartOver::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaStartOver::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -20605,8 +20549,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaStartOver::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaStartOver::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -20621,8 +20565,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaStartOverResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaStartOverResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; @@ -20632,8 +20576,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaStartOverResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaStartOverResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20648,8 +20592,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaPrevious::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaPrevious::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -20657,8 +20601,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaPrevious::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaPrevious::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -20673,8 +20617,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaPreviousResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaPreviousResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; @@ -20684,8 +20628,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaPreviousResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaPreviousResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20700,8 +20644,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaNext::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaNext::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -20709,8 +20653,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaNext::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaNext::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -20725,8 +20669,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaNextResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaNextResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; @@ -20736,8 +20680,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaNextResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaNextResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20752,8 +20696,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaRewind::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaRewind::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -20761,8 +20705,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaRewind::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaRewind::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -20777,8 +20721,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaRewindResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaRewindResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; @@ -20788,8 +20732,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaRewindResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaRewindResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20804,8 +20748,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaFastForward::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaFastForward::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -20813,8 +20757,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaFastForward::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaFastForward::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -20829,8 +20773,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaFastForwardResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaFastForwardResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; @@ -20840,8 +20784,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaFastForwardResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaFastForwardResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20857,8 +20801,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaSkipForward::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaSkipForward::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } uint64_t deltaPositionMilliseconds; @@ -20868,8 +20812,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaSkipForward::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaSkipForward::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } uint64_t deltaPositionMilliseconds; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20885,8 +20829,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaSkipForwardResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaSkipForwardResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; @@ -20896,8 +20840,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaSkipForwardResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaSkipForwardResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20913,8 +20857,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaSkipBackward::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaSkipBackward::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } uint64_t deltaPositionMilliseconds; @@ -20924,8 +20868,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaSkipBackward::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaSkipBackward::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } uint64_t deltaPositionMilliseconds; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20941,8 +20885,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaSkipBackwardResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaSkipBackwardResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; @@ -20952,8 +20896,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaSkipBackwardResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaSkipBackwardResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20969,8 +20913,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaSeek::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaSeek::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } uint64_t position; @@ -20980,8 +20924,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaSeek::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaSeek::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } uint64_t position; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -20997,8 +20941,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MediaSeekResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaSeekResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; @@ -21008,8 +20952,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MediaSeekResponse::Id; } - static constexpr ClusterId GetClusterId() { return MediaPlayback::Id; } + static constexpr CommandId GetCommandId() { return Commands::MediaSeekResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaPlayback::Id; } MediaPlaybackStatus mediaPlaybackStatus; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21182,8 +21126,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SelectInput::Id; } - static constexpr ClusterId GetClusterId() { return MediaInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::SelectInput::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } uint8_t index; @@ -21193,8 +21137,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SelectInput::Id; } - static constexpr ClusterId GetClusterId() { return MediaInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::SelectInput::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } uint8_t index; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21209,8 +21153,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ShowInputStatus::Id; } - static constexpr ClusterId GetClusterId() { return MediaInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::ShowInputStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -21218,8 +21162,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ShowInputStatus::Id; } - static constexpr ClusterId GetClusterId() { return MediaInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::ShowInputStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -21233,8 +21177,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return HideInputStatus::Id; } - static constexpr ClusterId GetClusterId() { return MediaInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::HideInputStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -21242,8 +21186,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return HideInputStatus::Id; } - static constexpr ClusterId GetClusterId() { return MediaInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::HideInputStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -21259,8 +21203,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RenameInput::Id; } - static constexpr ClusterId GetClusterId() { return MediaInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::RenameInput::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } uint8_t index; chip::CharSpan name; @@ -21271,8 +21215,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RenameInput::Id; } - static constexpr ClusterId GetClusterId() { return MediaInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::RenameInput::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::MediaInput::Id; } uint8_t index; chip::CharSpan name; @@ -21336,8 +21280,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Sleep::Id; } - static constexpr ClusterId GetClusterId() { return LowPower::Id; } + static constexpr CommandId GetCommandId() { return Commands::Sleep::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LowPower::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -21345,8 +21289,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Sleep::Id; } - static constexpr ClusterId GetClusterId() { return LowPower::Id; } + static constexpr CommandId GetCommandId() { return Commands::Sleep::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::LowPower::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -21498,8 +21442,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SendKey::Id; } - static constexpr ClusterId GetClusterId() { return KeypadInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::SendKey::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::KeypadInput::Id; } KeypadInputCecKeyCode keyCode; @@ -21509,8 +21453,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SendKey::Id; } - static constexpr ClusterId GetClusterId() { return KeypadInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::SendKey::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::KeypadInput::Id; } KeypadInputCecKeyCode keyCode; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21526,8 +21470,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SendKeyResponse::Id; } - static constexpr ClusterId GetClusterId() { return KeypadInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::SendKeyResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::KeypadInput::Id; } KeypadInputStatus status; @@ -21537,8 +21481,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SendKeyResponse::Id; } - static constexpr ClusterId GetClusterId() { return KeypadInput::Id; } + static constexpr CommandId GetCommandId() { return Commands::SendKeyResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::KeypadInput::Id; } KeypadInputStatus status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -21764,8 +21708,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return LaunchContent::Id; } - static constexpr ClusterId GetClusterId() { return ContentLauncher::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchContent::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } bool autoPlay; chip::CharSpan data; @@ -21776,8 +21720,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return LaunchContent::Id; } - static constexpr ClusterId GetClusterId() { return ContentLauncher::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchContent::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } bool autoPlay; chip::CharSpan data; @@ -21795,8 +21739,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return LaunchContentResponse::Id; } - static constexpr ClusterId GetClusterId() { return ContentLauncher::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchContentResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } chip::CharSpan data; ContentLaunchStatus contentLaunchStatus; @@ -21807,8 +21751,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return LaunchContentResponse::Id; } - static constexpr ClusterId GetClusterId() { return ContentLauncher::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchContentResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } chip::CharSpan data; ContentLaunchStatus contentLaunchStatus; @@ -21826,8 +21770,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return LaunchURL::Id; } - static constexpr ClusterId GetClusterId() { return ContentLauncher::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchURL::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } chip::CharSpan contentURL; chip::CharSpan displayString; @@ -21838,8 +21782,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return LaunchURL::Id; } - static constexpr ClusterId GetClusterId() { return ContentLauncher::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchURL::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } chip::CharSpan contentURL; chip::CharSpan displayString; @@ -21857,8 +21801,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return LaunchURLResponse::Id; } - static constexpr ClusterId GetClusterId() { return ContentLauncher::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchURLResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } chip::CharSpan data; ContentLaunchStatus contentLaunchStatus; @@ -21869,8 +21813,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return LaunchURLResponse::Id; } - static constexpr ClusterId GetClusterId() { return ContentLauncher::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchURLResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ContentLauncher::Id; } chip::CharSpan data; ContentLaunchStatus contentLaunchStatus; @@ -21976,8 +21920,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return SelectOutput::Id; } - static constexpr ClusterId GetClusterId() { return AudioOutput::Id; } + static constexpr CommandId GetCommandId() { return Commands::SelectOutput::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AudioOutput::Id; } uint8_t index; @@ -21987,8 +21931,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return SelectOutput::Id; } - static constexpr ClusterId GetClusterId() { return AudioOutput::Id; } + static constexpr CommandId GetCommandId() { return Commands::SelectOutput::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AudioOutput::Id; } uint8_t index; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -22005,8 +21949,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return RenameOutput::Id; } - static constexpr ClusterId GetClusterId() { return AudioOutput::Id; } + static constexpr CommandId GetCommandId() { return Commands::RenameOutput::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AudioOutput::Id; } uint8_t index; chip::CharSpan name; @@ -22017,8 +21961,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return RenameOutput::Id; } - static constexpr ClusterId GetClusterId() { return AudioOutput::Id; } + static constexpr CommandId GetCommandId() { return Commands::RenameOutput::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AudioOutput::Id; } uint8_t index; chip::CharSpan name; @@ -22121,8 +22065,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return LaunchApp::Id; } - static constexpr ClusterId GetClusterId() { return ApplicationLauncher::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchApp::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } chip::CharSpan data; uint16_t catalogVendorId; @@ -22134,8 +22078,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return LaunchApp::Id; } - static constexpr ClusterId GetClusterId() { return ApplicationLauncher::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchApp::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } chip::CharSpan data; uint16_t catalogVendorId; @@ -22154,8 +22098,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return LaunchAppResponse::Id; } - static constexpr ClusterId GetClusterId() { return ApplicationLauncher::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchAppResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } ApplicationLauncherStatus status; chip::CharSpan data; @@ -22166,8 +22110,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return LaunchAppResponse::Id; } - static constexpr ClusterId GetClusterId() { return ApplicationLauncher::Id; } + static constexpr CommandId GetCommandId() { return Commands::LaunchAppResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplicationLauncher::Id; } ApplicationLauncherStatus status; chip::CharSpan data; @@ -22256,8 +22200,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return ChangeStatus::Id; } - static constexpr ClusterId GetClusterId() { return ApplicationBasic::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplicationBasic::Id; } ApplicationBasicStatus status; @@ -22267,8 +22211,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return ChangeStatus::Id; } - static constexpr ClusterId GetClusterId() { return ApplicationBasic::Id; } + static constexpr CommandId GetCommandId() { return Commands::ChangeStatus::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplicationBasic::Id; } ApplicationBasicStatus status; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -22382,8 +22326,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetSetupPIN::Id; } - static constexpr ClusterId GetClusterId() { return AccountLogin::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetSetupPIN::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } chip::CharSpan tempAccountIdentifier; @@ -22393,8 +22337,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetSetupPIN::Id; } - static constexpr ClusterId GetClusterId() { return AccountLogin::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetSetupPIN::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } chip::CharSpan tempAccountIdentifier; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -22410,8 +22354,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetSetupPINResponse::Id; } - static constexpr ClusterId GetClusterId() { return AccountLogin::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetSetupPINResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } chip::CharSpan setupPIN; @@ -22421,8 +22365,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetSetupPINResponse::Id; } - static constexpr ClusterId GetClusterId() { return AccountLogin::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetSetupPINResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } chip::CharSpan setupPIN; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -22439,8 +22383,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Login::Id; } - static constexpr ClusterId GetClusterId() { return AccountLogin::Id; } + static constexpr CommandId GetCommandId() { return Commands::Login::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } chip::CharSpan tempAccountIdentifier; chip::CharSpan setupPIN; @@ -22451,8 +22395,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Login::Id; } - static constexpr ClusterId GetClusterId() { return AccountLogin::Id; } + static constexpr CommandId GetCommandId() { return Commands::Login::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::AccountLogin::Id; } chip::CharSpan tempAccountIdentifier; chip::CharSpan setupPIN; @@ -22537,6 +22481,61 @@ struct Type using DecodableType = Type; } // namespace SimpleStruct +namespace NullablesAndOptionalsStruct { +enum class Fields +{ + kNullableInt = 0, + kOptionalInt = 1, + kNullableOptionalInt = 2, + kNullableString = 3, + kOptionalString = 4, + kNullableOptionalString = 5, + kNullableStruct = 6, + kOptionalStruct = 7, + kNullableOptionalStruct = 8, + kNullableList = 9, + kOptionalList = 10, + kNullableOptionalList = 11, +}; + +struct Type +{ +public: + DataModel::Nullable nullableInt; + Optional optionalInt; + Optional> nullableOptionalInt; + DataModel::Nullable nullableString; + Optional optionalString; + Optional> nullableOptionalString; + DataModel::Nullable nullableStruct; + Optional optionalStruct; + Optional> nullableOptionalStruct; + DataModel::Nullable> nullableList; + Optional> optionalList; + Optional>> nullableOptionalList; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + DataModel::Nullable nullableInt; + Optional optionalInt; + Optional> nullableOptionalInt; + DataModel::Nullable nullableString; + Optional optionalString; + Optional> nullableOptionalString; + DataModel::Nullable nullableStruct; + Optional optionalStruct; + Optional> nullableOptionalStruct; + DataModel::Nullable> nullableList; + Optional> optionalList; + Optional>> nullableOptionalList; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace NullablesAndOptionalsStruct namespace NestedStruct { enum class Fields { @@ -22653,8 +22652,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Test::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::Test::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -22662,8 +22661,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Test::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::Test::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -22678,8 +22677,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestSpecificResponse::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestSpecificResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } uint8_t returnValue; @@ -22689,8 +22688,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestSpecificResponse::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestSpecificResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } uint8_t returnValue; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -22705,8 +22704,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestNotHandled::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestNotHandled::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -22714,8 +22713,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestNotHandled::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestNotHandled::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -22730,8 +22729,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestAddArgumentsResponse::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestAddArgumentsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } uint8_t returnValue; @@ -22741,8 +22740,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestAddArgumentsResponse::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestAddArgumentsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } uint8_t returnValue; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -22757,8 +22756,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestSpecific::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestSpecific::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -22766,8 +22765,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestSpecific::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestSpecific::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -22782,8 +22781,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestSimpleArgumentResponse::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestSimpleArgumentResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } bool returnValue; @@ -22793,8 +22792,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestSimpleArgumentResponse::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestSimpleArgumentResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } bool returnValue; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -22809,8 +22808,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestUnknownCommand::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestUnknownCommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -22818,8 +22817,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestUnknownCommand::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestUnknownCommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -22839,8 +22838,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestStructArrayArgumentResponse::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestStructArrayArgumentResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::List arg1; DataModel::List arg2; @@ -22855,8 +22854,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestStructArrayArgumentResponse::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestStructArrayArgumentResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::DecodableList arg1; DataModel::DecodableList arg2; @@ -22878,8 +22877,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestAddArguments::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestAddArguments::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } uint8_t arg1; uint8_t arg2; @@ -22890,8 +22889,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestAddArguments::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestAddArguments::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } uint8_t arg1; uint8_t arg2; @@ -22908,8 +22907,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestListInt8UReverseResponse::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestListInt8UReverseResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::List arg1; @@ -22919,8 +22918,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestListInt8UReverseResponse::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestListInt8UReverseResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::DecodableList arg1; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -22936,8 +22935,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestSimpleArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestSimpleArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } bool arg1; @@ -22947,8 +22946,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestSimpleArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestSimpleArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } bool arg1; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -22965,8 +22964,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestEnumsResponse::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestEnumsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } chip::VendorId arg1; SimpleEnum arg2; @@ -22977,8 +22976,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestEnumsResponse::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestEnumsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } chip::VendorId arg1; SimpleEnum arg2; @@ -23000,8 +22999,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestStructArrayArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestStructArrayArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::List arg1; DataModel::List arg2; @@ -23016,8 +23015,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestStructArrayArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestStructArrayArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::DecodableList arg1; DataModel::DecodableList arg2; @@ -23028,6 +23027,40 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestStructArrayArgumentRequest +namespace TestNullableOptionalResponse { +enum class Fields +{ + kWasPresent = 0, + kWasNull = 1, + kValue = 2, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::TestNullableOptionalResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + + bool wasPresent; + Optional wasNull; + Optional value; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::TestNullableOptionalResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + + bool wasPresent; + Optional wasNull; + Optional value; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace TestNullableOptionalResponse namespace TestStructArgumentRequest { enum class Fields { @@ -23038,8 +23071,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestStructArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestStructArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } Structs::SimpleStruct::Type arg1; @@ -23049,13 +23082,122 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestStructArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestStructArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } Structs::SimpleStruct::DecodableType arg1; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestStructArgumentRequest +namespace TestComplexNullableOptionalResponse { +enum class Fields +{ + kNullableIntWasNull = 0, + kNullableIntValue = 1, + kOptionalIntWasPresent = 2, + kOptionalIntValue = 3, + kNullableOptionalIntWasPresent = 4, + kNullableOptionalIntWasNull = 5, + kNullableOptionalIntValue = 6, + kNullableStringWasNull = 7, + kNullableStringValue = 8, + kOptionalStringWasPresent = 9, + kOptionalStringValue = 10, + kNullableOptionalStringWasPresent = 11, + kNullableOptionalStringWasNull = 12, + kNullableOptionalStringValue = 13, + kNullableStructWasNull = 14, + kNullableStructValue = 15, + kOptionalStructWasPresent = 16, + kOptionalStructValue = 17, + kNullableOptionalStructWasPresent = 18, + kNullableOptionalStructWasNull = 19, + kNullableOptionalStructValue = 20, + kNullableListWasNull = 21, + kNullableListValue = 22, + kOptionalListWasPresent = 23, + kOptionalListValue = 24, + kNullableOptionalListWasPresent = 25, + kNullableOptionalListWasNull = 26, + kNullableOptionalListValue = 27, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::TestComplexNullableOptionalResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + + bool nullableIntWasNull; + Optional nullableIntValue; + bool optionalIntWasPresent; + Optional optionalIntValue; + bool nullableOptionalIntWasPresent; + Optional nullableOptionalIntWasNull; + Optional nullableOptionalIntValue; + bool nullableStringWasNull; + Optional nullableStringValue; + bool optionalStringWasPresent; + Optional optionalStringValue; + bool nullableOptionalStringWasPresent; + Optional nullableOptionalStringWasNull; + Optional nullableOptionalStringValue; + bool nullableStructWasNull; + Optional nullableStructValue; + bool optionalStructWasPresent; + Optional optionalStructValue; + bool nullableOptionalStructWasPresent; + Optional nullableOptionalStructWasNull; + Optional nullableOptionalStructValue; + bool nullableListWasNull; + Optional> nullableListValue; + bool optionalListWasPresent; + Optional> optionalListValue; + bool nullableOptionalListWasPresent; + Optional nullableOptionalListWasNull; + Optional> nullableOptionalListValue; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::TestComplexNullableOptionalResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + + bool nullableIntWasNull; + Optional nullableIntValue; + bool optionalIntWasPresent; + Optional optionalIntValue; + bool nullableOptionalIntWasPresent; + Optional nullableOptionalIntWasNull; + Optional nullableOptionalIntValue; + bool nullableStringWasNull; + Optional nullableStringValue; + bool optionalStringWasPresent; + Optional optionalStringValue; + bool nullableOptionalStringWasPresent; + Optional nullableOptionalStringWasNull; + Optional nullableOptionalStringValue; + bool nullableStructWasNull; + Optional nullableStructValue; + bool optionalStructWasPresent; + Optional optionalStructValue; + bool nullableOptionalStructWasPresent; + Optional nullableOptionalStructWasNull; + Optional nullableOptionalStructValue; + bool nullableListWasNull; + Optional> nullableListValue; + bool optionalListWasPresent; + Optional> optionalListValue; + bool nullableOptionalListWasPresent; + Optional nullableOptionalListWasNull; + Optional> nullableOptionalListValue; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace TestComplexNullableOptionalResponse namespace TestNestedStructArgumentRequest { enum class Fields { @@ -23066,8 +23208,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestNestedStructArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestNestedStructArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } Structs::NestedStruct::Type arg1; @@ -23077,8 +23219,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestNestedStructArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestNestedStructArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } Structs::NestedStruct::DecodableType arg1; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -23094,8 +23236,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestListStructArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestListStructArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::List arg1; @@ -23105,8 +23247,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestListStructArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestListStructArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::DecodableList arg1; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -23122,8 +23264,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestListInt8UArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestListInt8UArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::List arg1; @@ -23133,8 +23275,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestListInt8UArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestListInt8UArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::DecodableList arg1; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -23150,8 +23292,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestNestedStructListArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestNestedStructListArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } Structs::NestedStructList::Type arg1; @@ -23161,8 +23303,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestNestedStructListArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestNestedStructListArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } Structs::NestedStructList::DecodableType arg1; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -23178,8 +23320,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestListNestedStructListArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestListNestedStructListArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::List arg1; @@ -23189,8 +23331,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestListNestedStructListArgumentRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestListNestedStructListArgumentRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::DecodableList arg1; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -23206,8 +23348,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestListInt8UReverseRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestListInt8UReverseRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::List arg1; @@ -23217,8 +23359,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestListInt8UReverseRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestListInt8UReverseRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } DataModel::DecodableList arg1; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -23235,8 +23377,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return TestEnumsRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestEnumsRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } chip::VendorId arg1; SimpleEnum arg2; @@ -23247,14 +23389,103 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return TestEnumsRequest::Id; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::TestEnumsRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } chip::VendorId arg1; SimpleEnum arg2; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestEnumsRequest +namespace TestNullableOptionalRequest { +enum class Fields +{ + kArg1 = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::TestNullableOptionalRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + + Optional> arg1; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::TestNullableOptionalRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + + Optional> arg1; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace TestNullableOptionalRequest +namespace TestComplexNullableOptionalRequest { +enum class Fields +{ + kNullableInt = 0, + kOptionalInt = 1, + kNullableOptionalInt = 2, + kNullableString = 3, + kOptionalString = 4, + kNullableOptionalString = 5, + kNullableStruct = 6, + kOptionalStruct = 7, + kNullableOptionalStruct = 8, + kNullableList = 9, + kOptionalList = 10, + kNullableOptionalList = 11, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::TestComplexNullableOptionalRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + + DataModel::Nullable nullableInt; + Optional optionalInt; + Optional> nullableOptionalInt; + DataModel::Nullable nullableString; + Optional optionalString; + Optional> nullableOptionalString; + DataModel::Nullable nullableStruct; + Optional optionalStruct; + Optional> nullableOptionalStruct; + DataModel::Nullable> nullableList; + Optional> optionalList; + Optional>> nullableOptionalList; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::TestComplexNullableOptionalRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } + + DataModel::Nullable nullableInt; + Optional optionalInt; + Optional> nullableOptionalInt; + DataModel::Nullable nullableString; + Optional optionalString; + Optional> nullableOptionalString; + DataModel::Nullable nullableStruct; + Optional optionalStruct; + Optional> nullableOptionalStruct; + DataModel::Nullable> nullableList; + Optional> optionalList; + Optional>> nullableOptionalList; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace TestComplexNullableOptionalRequest } // namespace Commands namespace Attributes { @@ -23559,7 +23790,7 @@ struct Type public: static constexpr PriorityLevel priorityLevel = PriorityLevel::Info; static constexpr EventId eventId = 0x00000001; - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } uint8_t arg1; SimpleEnum arg2; @@ -23576,7 +23807,7 @@ struct DecodableType public: static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } static constexpr EventId GetEventId() { return kEventId; } - static constexpr ClusterId GetClusterId() { return TestCluster::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } uint8_t arg1; SimpleEnum arg2; @@ -23773,8 +24004,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return DisplayMessage::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::DisplayMessage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } uint32_t messageId; chip::BitFlags messageControl; @@ -23789,8 +24020,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return DisplayMessage::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::DisplayMessage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } uint32_t messageId; chip::BitFlags messageControl; @@ -23810,8 +24041,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetLastMessage::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetLastMessage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -23819,8 +24050,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetLastMessage::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetLastMessage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -23836,8 +24067,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return CancelMessage::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::CancelMessage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } uint32_t messageId; chip::BitFlags messageControl; @@ -23848,8 +24079,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return CancelMessage::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::CancelMessage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } uint32_t messageId; chip::BitFlags messageControl; @@ -23869,8 +24100,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return MessageConfirmation::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::MessageConfirmation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } uint32_t messageId; uint32_t confirmationTime; @@ -23883,8 +24114,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return MessageConfirmation::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::MessageConfirmation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } uint32_t messageId; uint32_t confirmationTime; @@ -23908,8 +24139,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return DisplayProtectedMessage::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::DisplayProtectedMessage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } uint32_t messageId; chip::BitFlags messageControl; @@ -23924,8 +24155,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return DisplayProtectedMessage::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::DisplayProtectedMessage::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } uint32_t messageId; chip::BitFlags messageControl; @@ -23946,8 +24177,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetMessageCancellation::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetMessageCancellation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } uint32_t earliestImplementationTime; @@ -23957,8 +24188,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetMessageCancellation::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetMessageCancellation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } uint32_t earliestImplementationTime; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -23974,8 +24205,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return CancelAllMessages::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::CancelAllMessages::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } uint32_t implementationDateTime; @@ -23985,8 +24216,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return CancelAllMessages::Id; } - static constexpr ClusterId GetClusterId() { return Messaging::Id; } + static constexpr CommandId GetCommandId() { return Commands::CancelAllMessages::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } uint32_t implementationDateTime; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -24349,8 +24580,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetAlerts::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceEventsAndAlert::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetAlerts::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceEventsAndAlert::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -24358,8 +24589,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetAlerts::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceEventsAndAlert::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetAlerts::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceEventsAndAlert::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -24375,8 +24606,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetAlertsResponse::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceEventsAndAlert::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetAlertsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceEventsAndAlert::Id; } chip::BitFlags alertsCount; DataModel::List> alertStructures; @@ -24387,8 +24618,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetAlertsResponse::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceEventsAndAlert::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetAlertsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceEventsAndAlert::Id; } chip::BitFlags alertsCount; DataModel::DecodableList> alertStructures; @@ -24406,8 +24637,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return AlertsNotification::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceEventsAndAlert::Id; } + static constexpr CommandId GetCommandId() { return Commands::AlertsNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceEventsAndAlert::Id; } chip::BitFlags alertsCount; DataModel::List> alertStructures; @@ -24418,8 +24649,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return AlertsNotification::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceEventsAndAlert::Id; } + static constexpr CommandId GetCommandId() { return Commands::AlertsNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceEventsAndAlert::Id; } chip::BitFlags alertsCount; DataModel::DecodableList> alertStructures; @@ -24437,8 +24668,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return EventsNotification::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceEventsAndAlert::Id; } + static constexpr CommandId GetCommandId() { return Commands::EventsNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceEventsAndAlert::Id; } uint8_t eventHeader; EventIdentification eventId; @@ -24449,8 +24680,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return EventsNotification::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceEventsAndAlert::Id; } + static constexpr CommandId GetCommandId() { return Commands::EventsNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceEventsAndAlert::Id; } uint8_t eventHeader; EventIdentification eventId; @@ -24498,8 +24729,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return LogNotification::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceStatistics::Id; } + static constexpr CommandId GetCommandId() { return Commands::LogNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceStatistics::Id; } uint32_t timeStamp; uint32_t logId; @@ -24512,8 +24743,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return LogNotification::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceStatistics::Id; } + static constexpr CommandId GetCommandId() { return Commands::LogNotification::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceStatistics::Id; } uint32_t timeStamp; uint32_t logId; @@ -24532,8 +24763,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return LogRequest::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceStatistics::Id; } + static constexpr CommandId GetCommandId() { return Commands::LogRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceStatistics::Id; } uint32_t logId; @@ -24543,8 +24774,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return LogRequest::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceStatistics::Id; } + static constexpr CommandId GetCommandId() { return Commands::LogRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceStatistics::Id; } uint32_t logId; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -24563,8 +24794,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return LogResponse::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceStatistics::Id; } + static constexpr CommandId GetCommandId() { return Commands::LogResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceStatistics::Id; } uint32_t timeStamp; uint32_t logId; @@ -24577,8 +24808,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return LogResponse::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceStatistics::Id; } + static constexpr CommandId GetCommandId() { return Commands::LogResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceStatistics::Id; } uint32_t timeStamp; uint32_t logId; @@ -24596,8 +24827,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return LogQueueRequest::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceStatistics::Id; } + static constexpr CommandId GetCommandId() { return Commands::LogQueueRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceStatistics::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -24605,8 +24836,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return LogQueueRequest::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceStatistics::Id; } + static constexpr CommandId GetCommandId() { return Commands::LogQueueRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceStatistics::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -24622,8 +24853,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return LogQueueResponse::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceStatistics::Id; } + static constexpr CommandId GetCommandId() { return Commands::LogQueueResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceStatistics::Id; } uint8_t logQueueSize; DataModel::List logIds; @@ -24634,8 +24865,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return LogQueueResponse::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceStatistics::Id; } + static constexpr CommandId GetCommandId() { return Commands::LogQueueResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceStatistics::Id; } uint8_t logQueueSize; DataModel::DecodableList logIds; @@ -24653,8 +24884,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return StatisticsAvailable::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceStatistics::Id; } + static constexpr CommandId GetCommandId() { return Commands::StatisticsAvailable::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceStatistics::Id; } uint8_t logQueueSize; DataModel::List logIds; @@ -24665,8 +24896,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return StatisticsAvailable::Id; } - static constexpr ClusterId GetClusterId() { return ApplianceStatistics::Id; } + static constexpr CommandId GetCommandId() { return Commands::StatisticsAvailable::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ApplianceStatistics::Id; } uint8_t logQueueSize; DataModel::DecodableList logIds; @@ -24734,8 +24965,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetProfileInfoResponseCommand::Id; } - static constexpr ClusterId GetClusterId() { return ElectricalMeasurement::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetProfileInfoResponseCommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } uint8_t profileCount; uint8_t profileIntervalPeriod; @@ -24748,8 +24979,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetProfileInfoResponseCommand::Id; } - static constexpr ClusterId GetClusterId() { return ElectricalMeasurement::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetProfileInfoResponseCommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } uint8_t profileCount; uint8_t profileIntervalPeriod; @@ -24767,8 +24998,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetProfileInfoCommand::Id; } - static constexpr ClusterId GetClusterId() { return ElectricalMeasurement::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetProfileInfoCommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; }; @@ -24776,8 +25007,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetProfileInfoCommand::Id; } - static constexpr ClusterId GetClusterId() { return ElectricalMeasurement::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetProfileInfoCommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -24797,8 +25028,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetMeasurementProfileResponseCommand::Id; } - static constexpr ClusterId GetClusterId() { return ElectricalMeasurement::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetMeasurementProfileResponseCommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } uint32_t startTime; uint8_t status; @@ -24813,8 +25044,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetMeasurementProfileResponseCommand::Id; } - static constexpr ClusterId GetClusterId() { return ElectricalMeasurement::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetMeasurementProfileResponseCommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } uint32_t startTime; uint8_t status; @@ -24837,8 +25068,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return GetMeasurementProfileCommand::Id; } - static constexpr ClusterId GetClusterId() { return ElectricalMeasurement::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetMeasurementProfileCommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } uint16_t attributeId; uint32_t startTime; @@ -24850,8 +25081,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return GetMeasurementProfileCommand::Id; } - static constexpr ClusterId GetClusterId() { return ElectricalMeasurement::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetMeasurementProfileCommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } uint16_t attributeId; uint32_t startTime; @@ -26180,8 +26411,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Bind::Id; } - static constexpr ClusterId GetClusterId() { return Binding::Id; } + static constexpr CommandId GetCommandId() { return Commands::Bind::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } chip::NodeId nodeId; chip::GroupId groupId; @@ -26194,8 +26425,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Bind::Id; } - static constexpr ClusterId GetClusterId() { return Binding::Id; } + static constexpr CommandId GetCommandId() { return Commands::Bind::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } chip::NodeId nodeId; chip::GroupId groupId; @@ -26217,8 +26448,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Unbind::Id; } - static constexpr ClusterId GetClusterId() { return Binding::Id; } + static constexpr CommandId GetCommandId() { return Commands::Unbind::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } chip::NodeId nodeId; chip::GroupId groupId; @@ -26231,8 +26462,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Unbind::Id; } - static constexpr ClusterId GetClusterId() { return Binding::Id; } + static constexpr CommandId GetCommandId() { return Commands::Unbind::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Binding::Id; } chip::NodeId nodeId; chip::GroupId groupId; @@ -26387,8 +26618,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return CommandOne::Id; } - static constexpr ClusterId GetClusterId() { return SampleMfgSpecificCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::CommandOne::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SampleMfgSpecificCluster::Id; } uint8_t argOne; @@ -26398,8 +26629,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return CommandOne::Id; } - static constexpr ClusterId GetClusterId() { return SampleMfgSpecificCluster::Id; } + static constexpr CommandId GetCommandId() { return Commands::CommandOne::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SampleMfgSpecificCluster::Id; } uint8_t argOne; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -26463,8 +26694,8 @@ struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return CommandTwo::Id; } - static constexpr ClusterId GetClusterId() { return SampleMfgSpecificCluster2::Id; } + static constexpr CommandId GetCommandId() { return Commands::CommandTwo::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SampleMfgSpecificCluster2::Id; } uint8_t argOne; @@ -26474,8 +26705,8 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return CommandTwo::Id; } - static constexpr ClusterId GetClusterId() { return SampleMfgSpecificCluster2::Id; } + static constexpr CommandId GetCommandId() { return Commands::CommandTwo::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SampleMfgSpecificCluster2::Id; } uint8_t argOne; CHIP_ERROR Decode(TLV::TLVReader & reader); diff --git a/zzz_generated/app-common/app-common/zap-generated/command-id.h b/zzz_generated/app-common/app-common/zap-generated/command-id.h index 9b06034094b782..c7ca035095d600 100644 --- a/zzz_generated/app-common/app-common/zap-generated/command-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/command-id.h @@ -443,7 +443,9 @@ #define ZCL_TEST_SIMPLE_ARGUMENT_REQUEST_COMMAND_ID (0x05) #define ZCL_TEST_ENUMS_RESPONSE_COMMAND_ID (0x05) #define ZCL_TEST_STRUCT_ARRAY_ARGUMENT_REQUEST_COMMAND_ID (0x06) +#define ZCL_TEST_NULLABLE_OPTIONAL_RESPONSE_COMMAND_ID (0x06) #define ZCL_TEST_STRUCT_ARGUMENT_REQUEST_COMMAND_ID (0x07) +#define ZCL_TEST_COMPLEX_NULLABLE_OPTIONAL_RESPONSE_COMMAND_ID (0x07) #define ZCL_TEST_NESTED_STRUCT_ARGUMENT_REQUEST_COMMAND_ID (0x08) #define ZCL_TEST_LIST_STRUCT_ARGUMENT_REQUEST_COMMAND_ID (0x09) #define ZCL_TEST_LIST_INT8_U_ARGUMENT_REQUEST_COMMAND_ID (0x0A) @@ -451,6 +453,8 @@ #define ZCL_TEST_LIST_NESTED_STRUCT_LIST_ARGUMENT_REQUEST_COMMAND_ID (0x0C) #define ZCL_TEST_LIST_INT8_U_REVERSE_REQUEST_COMMAND_ID (0x0D) #define ZCL_TEST_ENUMS_REQUEST_COMMAND_ID (0x0E) +#define ZCL_TEST_NULLABLE_OPTIONAL_REQUEST_COMMAND_ID (0x0F) +#define ZCL_TEST_COMPLEX_NULLABLE_OPTIONAL_REQUEST_COMMAND_ID (0x10) // Commands for cluster: Messaging #define ZCL_DISPLAY_MESSAGE_COMMAND_ID (0x00) 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 70411ed21f5ec6..faed693686ce08 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 @@ -1588,10 +1588,18 @@ namespace TestStructArrayArgumentRequest { static constexpr CommandId Id = 0x00000006; } // namespace TestStructArrayArgumentRequest +namespace TestNullableOptionalResponse { +static constexpr CommandId Id = 0x00000006; +} // namespace TestNullableOptionalResponse + namespace TestStructArgumentRequest { static constexpr CommandId Id = 0x00000007; } // namespace TestStructArgumentRequest +namespace TestComplexNullableOptionalResponse { +static constexpr CommandId Id = 0x00000007; +} // namespace TestComplexNullableOptionalResponse + namespace TestNestedStructArgumentRequest { static constexpr CommandId Id = 0x00000008; } // namespace TestNestedStructArgumentRequest @@ -1620,6 +1628,14 @@ namespace TestEnumsRequest { static constexpr CommandId Id = 0x0000000E; } // namespace TestEnumsRequest +namespace TestNullableOptionalRequest { +static constexpr CommandId Id = 0x0000000F; +} // namespace TestNullableOptionalRequest + +namespace TestComplexNullableOptionalRequest { +static constexpr CommandId Id = 0x00000010; +} // namespace TestComplexNullableOptionalRequest + } // namespace Commands } // namespace TestCluster diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 2e96e1c9391f32..6bf93c9e245575 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -1848,6 +1848,18 @@ static void OnTestClusterTestListInt8UReverseResponseSuccess( command->SetCommandExitStatus(CHIP_NO_ERROR); }; +static void OnTestClusterTestNullableOptionalResponseSuccess( + void * context, const chip::app::Clusters::TestCluster::Commands::TestNullableOptionalResponse::DecodableType & data) +{ + ChipLogProgress(Zcl, "Received TestNullableOptionalResponse:"); + ChipLogProgress(Zcl, " wasPresent: %d", data.wasPresent); + ChipLogProgress(Zcl, " wasNull: Optional printing is not implemented yet."); + ChipLogProgress(Zcl, " value: Optional printing is not implemented yet."); + + ModelCommand * command = static_cast(context); + command->SetCommandExitStatus(CHIP_NO_ERROR); +}; + static void OnTestClusterTestSpecificResponseSuccess( void * context, const chip::app::Clusters::TestCluster::Commands::TestSpecificResponse::DecodableType & data) { @@ -10120,6 +10132,7 @@ class ReadFixedLabelClusterRevision : public ModelCommand | * MeasuredValue | 0x0000 | | * MinMeasuredValue | 0x0001 | | * MaxMeasuredValue | 0x0002 | +| * Tolerance | 0x0003 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -10225,6 +10238,40 @@ class ReadFlowMeasurementMaxMeasuredValue : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; +/* + * Attribute Tolerance + */ +class ReadFlowMeasurementTolerance : public ModelCommand +{ +public: + ReadFlowMeasurementTolerance() : ModelCommand("read") + { + AddArgument("attr-name", "tolerance"); + ModelCommand::AddArguments(); + } + + ~ReadFlowMeasurementTolerance() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0404) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::FlowMeasurementCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeTolerance(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + /* * Attribute ClusterRevision */ @@ -17047,6 +17094,7 @@ class ReadPumpConfigurationAndControlClusterRevision : public ModelCommand | * MeasuredValue | 0x0000 | | * MinMeasuredValue | 0x0001 | | * MaxMeasuredValue | 0x0002 | +| * Tolerance | 0x0003 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -17198,6 +17246,86 @@ class ReadRelativeHumidityMeasurementMaxMeasuredValue : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; +/* + * Attribute Tolerance + */ +class ReadRelativeHumidityMeasurementTolerance : public ModelCommand +{ +public: + ReadRelativeHumidityMeasurementTolerance() : ModelCommand("read") + { + AddArgument("attr-name", "tolerance"); + ModelCommand::AddArguments(); + } + + ~ReadRelativeHumidityMeasurementTolerance() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0405) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeTolerance(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class ReportRelativeHumidityMeasurementTolerance : public ModelCommand +{ +public: + ReportRelativeHumidityMeasurementTolerance() : ModelCommand("report") + { + AddArgument("attr-name", "tolerance"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + ModelCommand::AddArguments(); + } + + ~ReportRelativeHumidityMeasurementTolerance() + { + delete onSuccessCallback; + delete onFailureCallback; + delete onReportCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0405) command (0x06) on endpoint %" PRIu8, endpointId); + + chip::Controller::RelativeHumidityMeasurementCluster cluster; + cluster.Associate(device, endpointId); + + CHIP_ERROR err = cluster.ReportAttributeTolerance(onReportCallback->Cancel()); + if (err != CHIP_NO_ERROR) + { + return err; + } + + return cluster.SubscribeAttributeTolerance(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval, + mMaxInterval); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + uint16_t mMinInterval; + uint16_t mMaxInterval; +}; + /* * Attribute ClusterRevision */ @@ -18313,6 +18441,7 @@ class ReadTargetNavigatorClusterRevision : public ModelCommand | * MeasuredValue | 0x0000 | | * MinMeasuredValue | 0x0001 | | * MaxMeasuredValue | 0x0002 | +| * Tolerance | 0x0003 | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -18464,6 +18593,86 @@ class ReadTemperatureMeasurementMaxMeasuredValue : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; +/* + * Attribute Tolerance + */ +class ReadTemperatureMeasurementTolerance : public ModelCommand +{ +public: + ReadTemperatureMeasurementTolerance() : ModelCommand("read") + { + AddArgument("attr-name", "tolerance"); + ModelCommand::AddArguments(); + } + + ~ReadTemperatureMeasurementTolerance() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeTolerance(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class ReportTemperatureMeasurementTolerance : public ModelCommand +{ +public: + ReportTemperatureMeasurementTolerance() : ModelCommand("report") + { + AddArgument("attr-name", "tolerance"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + ModelCommand::AddArguments(); + } + + ~ReportTemperatureMeasurementTolerance() + { + delete onSuccessCallback; + delete onFailureCallback; + delete onReportCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x06) on endpoint %" PRIu8, endpointId); + + chip::Controller::TemperatureMeasurementCluster cluster; + cluster.Associate(device, endpointId); + + CHIP_ERROR err = cluster.ReportAttributeTolerance(onReportCallback->Cancel()); + if (err != CHIP_NO_ERROR) + { + return err; + } + + return cluster.SubscribeAttributeTolerance(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval, + mMaxInterval); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + uint16_t mMinInterval; + uint16_t mMaxInterval; +}; + /* * Attribute ClusterRevision */ @@ -18509,6 +18718,7 @@ class ReadTemperatureMeasurementClusterRevision : public ModelCommand | * TestListInt8UReverseRequest | 0x0D | | * TestListStructArgumentRequest | 0x09 | | * TestNotHandled | 0x01 | +| * TestNullableOptionalRequest | 0x0F | | * TestSpecific | 0x02 | | * TestStructArgumentRequest | 0x07 | | * TestUnknownCommand | 0x03 | @@ -18712,6 +18922,31 @@ class TestClusterTestNotHandled : public ModelCommand chip::app::Clusters::TestCluster::Commands::TestNotHandled::Type mRequest; }; +/* + * Command TestNullableOptionalRequest + */ +class TestClusterTestNullableOptionalRequest : public ModelCommand +{ +public: + TestClusterTestNullableOptionalRequest() : ModelCommand("test-nullable-optional-request") + { + AddArgument("Arg1", 0, UINT8_MAX, &mRequest.arg1); + ModelCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000050F) command (0x0000000F) on endpoint %" PRIu8, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.InvokeCommand(mRequest, this, OnTestClusterTestNullableOptionalResponseSuccess, OnDefaultFailure); + } + +private: + chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type mRequest; +}; + /* * Command TestSpecific */ @@ -20480,6 +20715,7 @@ class ReadTestClusterClusterRevision : public ModelCommand | * MaxHeatSetpointLimit | 0x0016 | | * MinCoolSetpointLimit | 0x0017 | | * MaxCoolSetpointLimit | 0x0018 | +| * MinSetpointDeadBand | 0x0019 | | * ControlSequenceOfOperation | 0x001B | | * SystemMode | 0x001C | | * StartOfWeek | 0x0020 | @@ -21236,6 +21472,73 @@ class WriteThermostatMaxCoolSetpointLimit : public ModelCommand int16_t mValue; }; +/* + * Attribute MinSetpointDeadBand + */ +class ReadThermostatMinSetpointDeadBand : public ModelCommand +{ +public: + ReadThermostatMinSetpointDeadBand() : ModelCommand("read") + { + AddArgument("attr-name", "min-setpoint-dead-band"); + ModelCommand::AddArguments(); + } + + ~ReadThermostatMinSetpointDeadBand() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeMinSetpointDeadBand(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteThermostatMinSetpointDeadBand : public ModelCommand +{ +public: + WriteThermostatMinSetpointDeadBand() : ModelCommand("write") + { + AddArgument("attr-name", "min-setpoint-dead-band"); + AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteThermostatMinSetpointDeadBand() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu8, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeMinSetpointDeadBand(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + int8_t mValue; +}; + /* * Attribute ControlSequenceOfOperation */ @@ -24692,6 +24995,7 @@ class ReadWiFiNetworkDiagnosticsClusterRevision : public ModelCommand | * InstalledClosedLimitTilt | 0x0013 | | * Mode | 0x0017 | | * SafetyStatus | 0x001A | +| * FeatureMap | 0xFFFC | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ @@ -25873,6 +26177,40 @@ class ReportWindowCoveringSafetyStatus : public ModelCommand uint16_t mMaxInterval; }; +/* + * Attribute FeatureMap + */ +class ReadWindowCoveringFeatureMap : public ModelCommand +{ +public: + ReadWindowCoveringFeatureMap() : ModelCommand("read") + { + AddArgument("attr-name", "feature-map"); + ModelCommand::AddArguments(); + } + + ~ReadWindowCoveringFeatureMap() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::WindowCoveringCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeFeatureMap(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt32uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + /* * Attribute ClusterRevision */ @@ -26329,6 +26667,7 @@ void registerClusterFlowMeasurement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // }; @@ -26736,6 +27075,8 @@ void registerClusterRelativeHumidityMeasurement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // }; @@ -26827,6 +27168,8 @@ void registerClusterTemperatureMeasurement(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // }; @@ -26844,6 +27187,7 @@ void registerClusterTestCluster(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -26929,6 +27273,8 @@ void registerClusterThermostat(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -27106,6 +27452,7 @@ void registerClusterWindowCovering(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(), // }; diff --git a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h b/zzz_generated/chip-tool/zap-generated/reporting/Commands.h index 9453b5dc06ce30..2cbb2db9bf087c 100644 --- a/zzz_generated/chip-tool/zap-generated/reporting/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/reporting/Commands.h @@ -47,8 +47,10 @@ class Listen : public ReportingCommand delete onReportPumpConfigurationAndControlPumpStatusCallback; delete onReportPumpConfigurationAndControlCapacityCallback; delete onReportRelativeHumidityMeasurementMeasuredValueCallback; + delete onReportRelativeHumidityMeasurementToleranceCallback; delete onReportSwitchCurrentPositionCallback; delete onReportTemperatureMeasurementMeasuredValueCallback; + delete onReportTemperatureMeasurementToleranceCallback; delete onReportThermostatLocalTemperatureCallback; delete onReportWindowCoveringCurrentPositionLiftPercentageCallback; delete onReportWindowCoveringCurrentPositionTiltPercentageCallback; @@ -103,11 +105,17 @@ class Listen : public ReportingCommand callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0405, 0x0000, onReportRelativeHumidityMeasurementMeasuredValueCallback->Cancel(), BasicAttributeFilter); + callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0405, 0x0003, + onReportRelativeHumidityMeasurementToleranceCallback->Cancel(), + BasicAttributeFilter); callbacksMgr.AddReportCallback(remoteId, endpointId, 0x003B, 0x0001, onReportSwitchCurrentPositionCallback->Cancel(), BasicAttributeFilter); callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0402, 0x0000, onReportTemperatureMeasurementMeasuredValueCallback->Cancel(), BasicAttributeFilter); + callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0402, 0x0003, + onReportTemperatureMeasurementToleranceCallback->Cancel(), + BasicAttributeFilter); callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0201, 0x0000, onReportThermostatLocalTemperatureCallback->Cancel(), BasicAttributeFilter); callbacksMgr.AddReportCallback(remoteId, endpointId, 0x0102, 0x0008, @@ -202,10 +210,14 @@ class Listen : public ReportingCommand new chip::Callback::Callback(OnInt16sAttributeResponse, this); chip::Callback::Callback * onReportRelativeHumidityMeasurementMeasuredValueCallback = new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onReportRelativeHumidityMeasurementToleranceCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); chip::Callback::Callback * onReportSwitchCurrentPositionCallback = new chip::Callback::Callback(OnInt8uAttributeResponse, this); chip::Callback::Callback * onReportTemperatureMeasurementMeasuredValueCallback = new chip::Callback::Callback(OnInt16sAttributeResponse, this); + chip::Callback::Callback * onReportTemperatureMeasurementToleranceCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); chip::Callback::Callback * onReportThermostatLocalTemperatureCallback = new chip::Callback::Callback(OnInt16sAttributeResponse, this); chip::Callback::Callback * onReportWindowCoveringCurrentPositionLiftPercentageCallback = diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 6c68afa67a552d..13f26b14274534 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -11748,10 +11748,10 @@ class Test_TC_MC_1_1 : public TestCommand void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } }; -class Test_TC_OCC_1_1 : public TestCommand +class Test_TC_MC_3_6 : public TestCommand { public: - Test_TC_OCC_1_1() : TestCommand("Test_TC_OCC_1_1"), mTestIndex(0) {} + Test_TC_MC_3_6() : TestCommand("Test_TC_MC_3_6"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -11760,12 +11760,12 @@ class Test_TC_OCC_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_6\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_6\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -11778,15 +11778,6 @@ class Test_TC_OCC_1_1 : public TestCommand // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_0(); - break; - case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); - break; } if (CHIP_NO_ERROR != err) @@ -11798,73 +11789,113 @@ class Test_TC_OCC_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 0; - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + // + // Tests methods + // +}; - static void OnFailureCallback_0(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_0(status); - } +class Test_TC_MC_3_7 : public TestCommand +{ +public: + Test_TC_MC_3_7() : TestCommand("Test_TC_MC_3_7"), mTestIndex(0) {} - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnFailureCallback_1(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_1(status); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_7\n"); + } - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_7\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; + // // Tests methods // +}; - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() - { - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); +class Test_TC_MC_3_8 : public TestCommand +{ +public: + Test_TC_MC_3_8() : TestCommand("Test_TC_MC_3_8"), mTestIndex(0) {} - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); - } + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_8\n"); + } - void OnSuccessResponse_0(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 2U)); - NextTest(); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_8\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() - { - chip::Controller::OccupancySensingClusterTest cluster; - cluster.Associate(mDevice, 1); + Wait(); - uint16_t clusterRevisionArgument = 2U; + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + } - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), - clusterRevisionArgument); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_1(uint8_t status) { NextTest(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; - void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + // + // Tests methods + // }; -class Test_TC_OO_1_1 : public TestCommand +class Test_TC_MC_3_9 : public TestCommand { public: - Test_TC_OO_1_1() : TestCommand("Test_TC_OO_1_1"), mTestIndex(0) {} + Test_TC_MC_3_9() : TestCommand("Test_TC_MC_3_9"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -11873,12 +11904,12 @@ class Test_TC_OO_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_9\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_9\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -11891,31 +11922,6 @@ class Test_TC_OO_1_1 : public TestCommand // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_0(); - break; - case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read the optional global attribute: FeatureMap\n"); - err = TestReadTheOptionalGlobalAttributeFeatureMap_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : write the default values to optional global attribute: FeatureMap\n"); - err = TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : reads back optional global attribute: FeatureMap\n"); - err = TestReadsBackOptionalGlobalAttributeFeatureMap_5(); - break; } if (CHIP_NO_ERROR != err) @@ -11927,183 +11933,226 @@ class Test_TC_OO_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; - - chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; - chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - - static void OnFailureCallback_0(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_0(status); - } - - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); - } - - static void OnFailureCallback_1(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_1(status); - } + const uint16_t mTestCount = 0; - static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) - { - (static_cast(context))->OnSuccessResponse_1(clusterRevision); - } + // + // Tests methods + // +}; - static void OnFailureCallback_2(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_2(status); - } +class Test_TC_MC_3_10 : public TestCommand +{ +public: + Test_TC_MC_3_10() : TestCommand("Test_TC_MC_3_10"), mTestIndex(0) {} - static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnSuccessResponse_2(clusterRevision); - } + CHIP_ERROR err = CHIP_NO_ERROR; - static void OnFailureCallback_3(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_3(status); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_10\n"); + } - static void OnSuccessCallback_3(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_3(featureMap); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_10\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - static void OnFailureCallback_4(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_4(status); - } + Wait(); - static void OnSuccessCallback_4(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_4(featureMap); - } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + } - static void OnFailureCallback_5(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_5(status); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnSuccessCallback_5(void * context, uint32_t featureMap) - { - (static_cast(context))->OnSuccessResponse_5(featureMap); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; // // Tests methods // +}; - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); +class Test_TC_MC_3_11 : public TestCommand +{ +public: + Test_TC_MC_3_11() : TestCommand("Test_TC_MC_3_11"), mTestIndex(0) {} - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); - } + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_11\n"); + } - void OnSuccessResponse_0(uint16_t clusterRevision) - { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 4U)); - NextTest(); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_11\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + Wait(); - uint16_t clusterRevisionArgument = 3U; + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + } - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), - clusterRevisionArgument); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_1(uint8_t status) { NextTest(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; - void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } + // + // Tests methods + // +}; - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() +class Test_TC_OCC_1_1 : public TestCommand +{ +public: + Test_TC_OCC_1_1() : TestCommand("Test_TC_OCC_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + CHIP_ERROR err = CHIP_NO_ERROR; - return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; - void OnSuccessResponse_2(uint16_t clusterRevision) + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) { - VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 4U)); - NextTest(); + (static_cast(context))->OnFailureResponse_0(status); } - CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_3() + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeFeatureMap(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } - void OnSuccessResponse_3(uint32_t featureMap) + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); - NextTest(); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } - CHIP_ERROR TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_4() + // + // Tests methods + // + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::OccupancySensingClusterTest cluster; cluster.Associate(mDevice, 1); - uint32_t featureMapArgument = 0UL; - - return cluster.WriteAttributeFeatureMap(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), featureMapArgument); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } - void OnFailureResponse_4(uint8_t status) { NextTest(); } + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_4(uint32_t featureMap) { ThrowSuccessResponse(); } + void OnSuccessResponse_0(uint16_t clusterRevision) + { + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 2U)); + NextTest(); + } - CHIP_ERROR TestReadsBackOptionalGlobalAttributeFeatureMap_5() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::OccupancySensingClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeFeatureMap(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + uint16_t clusterRevisionArgument = 2U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + clusterRevisionArgument); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { NextTest(); } - void OnSuccessResponse_5(uint32_t featureMap) - { - VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); - NextTest(); - } + void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } }; -class Test_TC_OO_2_1 : public TestCommand +class Test_TC_OCC_2_1 : public TestCommand { public: - Test_TC_OO_2_1() : TestCommand("Test_TC_OO_2_1"), mTestIndex(0) {} + Test_TC_OCC_2_1() : TestCommand("Test_TC_OCC_2_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -12112,12 +12161,12 @@ class Test_TC_OO_2_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OCC_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OCC_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -12131,52 +12180,44 @@ class Test_TC_OO_2_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: OnOff\n"); - err = TestReadTheMandatoryAttributeOnOff_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Reads mandatory attribute constrains: Occupancy\n"); + err = TestReadsMandatoryAttributeConstrainsOccupancy_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : reads back mandatory attribute: OnOff\n"); - err = TestReadsBackMandatoryAttributeOnOff_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : Writes the respective default value to mandatory attribute: Occupancy\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancy_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read LT attribute: GlobalSceneControl\n"); - err = TestReadLtAttributeGlobalSceneControl_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Reads back mandatory attribute: Occupancy\n"); + err = TestReadsBackMandatoryAttributeOccupancy_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read LT attribute: OnTime\n"); - err = TestReadLtAttributeOnTime_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Reads mandatory attribute constrains: OccupancySensorType\n"); + err = TestReadsMandatoryAttributeConstrainsOccupancySensorType_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read LT attribute: OffWaitTime\n"); - err = TestReadLtAttributeOffWaitTime_4(); + ChipLogProgress( + chipTool, " ***** Test Step 4 : Writes the respective default value to mandatory attribute: OccupancySensorType\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorType_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read LT attribute: StartUpOnOff\n"); - err = TestReadLtAttributeStartUpOnOff_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Reads back mandatory attribute: OccupancySensorType\n"); + err = TestReadsBackMandatoryAttributeOccupancySensorType_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : write the default value to LT attribute: OnTime\n"); - err = TestWriteTheDefaultValueToLtAttributeOnTime_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Reads mandatory attribute constrains: OccupancySensorTypeBitmap\n"); + err = TestReadsMandatoryAttributeConstrainsOccupancySensorTypeBitmap_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : write the default value to LT attribute: OffWaitTime\n"); - err = TestWriteTheDefaultValueToLtAttributeOffWaitTime_7(); + ChipLogProgress( + chipTool, + " ***** Test Step 7 : Writes the respective default value to mandatory attribute: OccupancySensorTypeBitmap\n"); + err = TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorTypeBitmap_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : write the default value to LT attribute: StartUpOnOff\n"); - err = TestWriteTheDefaultValueToLtAttributeStartUpOnOff_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : reads back LT attribute: OnTime\n"); - err = TestReadsBackLtAttributeOnTime_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : reads back LT attribute: OffWaitTime\n"); - err = TestReadsBackLtAttributeOffWaitTime_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : reads back LT attribute: StartUpOnOff\n"); - err = TestReadsBackLtAttributeStartUpOnOff_11(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Reads back mandatory attribute: OccupancySensorTypeBitmap\n"); + err = TestReadsBackMandatoryAttributeOccupancySensorTypeBitmap_8(); break; } @@ -12189,349 +12230,276 @@ class Test_TC_OO_2_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; + const uint16_t mTestCount = 9; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, + this }; chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, + this }; chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, + this }; chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, + this }; chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, + this }; chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; - chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; - chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; - chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; - chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; - chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; - chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; + chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, + this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, bool onOff) + static void OnSuccessCallback_0(void * context, uint8_t occupancy) { - (static_cast(context))->OnSuccessResponse_0(onOff); + (static_cast(context))->OnSuccessResponse_0(occupancy); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, bool onOff) + static void OnSuccessCallback_1(void * context, uint8_t occupancy) { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnSuccessResponse_1(occupancy); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, bool globalSceneControl) + static void OnSuccessCallback_2(void * context, uint8_t occupancy) { - (static_cast(context))->OnSuccessResponse_2(globalSceneControl); + (static_cast(context))->OnSuccessResponse_2(occupancy); } static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnSuccessCallback_3(void * context, uint16_t onTime) + static void OnSuccessCallback_3(void * context, uint8_t occupancySensorType) { - (static_cast(context))->OnSuccessResponse_3(onTime); + (static_cast(context))->OnSuccessResponse_3(occupancySensorType); } static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_4(status); + (static_cast(context))->OnFailureResponse_4(status); } - static void OnSuccessCallback_4(void * context, uint16_t offWaitTime) + static void OnSuccessCallback_4(void * context, uint8_t occupancySensorType) { - (static_cast(context))->OnSuccessResponse_4(offWaitTime); + (static_cast(context))->OnSuccessResponse_4(occupancySensorType); } static void OnFailureCallback_5(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnFailureResponse_5(status); } - static void OnSuccessCallback_5(void * context, uint8_t startUpOnOff) + static void OnSuccessCallback_5(void * context, uint8_t occupancySensorType) { - (static_cast(context))->OnSuccessResponse_5(startUpOnOff); + (static_cast(context))->OnSuccessResponse_5(occupancySensorType); } static void OnFailureCallback_6(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_6(status); + (static_cast(context))->OnFailureResponse_6(status); } - static void OnSuccessCallback_6(void * context, uint16_t onTime) + static void OnSuccessCallback_6(void * context, uint8_t occupancySensorTypeBitmap) { - (static_cast(context))->OnSuccessResponse_6(onTime); + (static_cast(context))->OnSuccessResponse_6(occupancySensorTypeBitmap); } static void OnFailureCallback_7(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_7(status); + (static_cast(context))->OnFailureResponse_7(status); } - static void OnSuccessCallback_7(void * context, uint16_t offWaitTime) + static void OnSuccessCallback_7(void * context, uint8_t occupancySensorTypeBitmap) { - (static_cast(context))->OnSuccessResponse_7(offWaitTime); + (static_cast(context))->OnSuccessResponse_7(occupancySensorTypeBitmap); } static void OnFailureCallback_8(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_8(status); + (static_cast(context))->OnFailureResponse_8(status); } - static void OnSuccessCallback_8(void * context, uint8_t startUpOnOff) + static void OnSuccessCallback_8(void * context, uint8_t occupancySensorTypeBitmap) { - (static_cast(context))->OnSuccessResponse_8(startUpOnOff); + (static_cast(context))->OnSuccessResponse_8(occupancySensorTypeBitmap); } - static void OnFailureCallback_9(void * context, uint8_t status) + // + // Tests methods + // + + CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancy_0() { - (static_cast(context))->OnFailureResponse_9(status); - } - - static void OnSuccessCallback_9(void * context, uint16_t onTime) - { - (static_cast(context))->OnSuccessResponse_9(onTime); - } - - static void OnFailureCallback_10(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_10(status); - } - - static void OnSuccessCallback_10(void * context, uint16_t offWaitTime) - { - (static_cast(context))->OnSuccessResponse_10(offWaitTime); - } - - static void OnFailureCallback_11(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_11(status); - } - - static void OnSuccessCallback_11(void * context, uint8_t startUpOnOff) - { - (static_cast(context))->OnSuccessResponse_11(startUpOnOff); - } - - // - // Tests methods - // - - CHIP_ERROR TestReadTheMandatoryAttributeOnOff_0() - { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::OccupancySensingClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + return cluster.ReadAttributeOccupancy(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(bool onOff) + void OnSuccessResponse_0(uint8_t occupancy) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckConstraintType("occupancy", "", "map8")); + VerifyOrReturn(CheckConstraintMaxValue("occupancy", occupancy, 1)); NextTest(); } - CHIP_ERROR TestReadsBackMandatoryAttributeOnOff_1() + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancy_1() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::OccupancySensingClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + uint8_t occupancyArgument = 0; + + return cluster.WriteAttributeOccupancy(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), occupancyArgument); } - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { NextTest(); } - void OnSuccessResponse_1(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - NextTest(); - } + void OnSuccessResponse_1(uint8_t occupancy) { ThrowSuccessResponse(); } - CHIP_ERROR TestReadLtAttributeGlobalSceneControl_2() + CHIP_ERROR TestReadsBackMandatoryAttributeOccupancy_2() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::OccupancySensingClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeGlobalSceneControl(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + return cluster.ReadAttributeOccupancy(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_2(bool globalSceneControl) + void OnSuccessResponse_2(uint8_t occupancy) { - VerifyOrReturn(CheckValue("globalSceneControl", globalSceneControl, 1)); + VerifyOrReturn(CheckValue("occupancy", occupancy, 0)); NextTest(); } - CHIP_ERROR TestReadLtAttributeOnTime_3() + CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorType_3() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::OccupancySensingClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnTime(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + return cluster.ReadAttributeOccupancySensorType(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(uint16_t onTime) + void OnSuccessResponse_3(uint8_t occupancySensorType) { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); + VerifyOrReturn(CheckConstraintType("occupancySensorType", "", "enum8")); + VerifyOrReturn(CheckConstraintMaxValue("occupancySensorType", occupancySensorType, 3)); NextTest(); } - CHIP_ERROR TestReadLtAttributeOffWaitTime_4() + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorType_4() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::OccupancySensingClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOffWaitTime(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + uint8_t occupancySensorTypeArgument = static_cast(0); + + return cluster.WriteAttributeOccupancySensorType(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), + occupancySensorTypeArgument); } - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { NextTest(); } - void OnSuccessResponse_4(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - NextTest(); - } + void OnSuccessResponse_4(uint8_t occupancySensorType) { ThrowSuccessResponse(); } - CHIP_ERROR TestReadLtAttributeStartUpOnOff_5() + CHIP_ERROR TestReadsBackMandatoryAttributeOccupancySensorType_5() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::OccupancySensingClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeStartUpOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + return cluster.ReadAttributeOccupancySensorType(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(uint8_t startUpOnOff) + void OnSuccessResponse_5(uint8_t occupancySensorType) { - VerifyOrReturn(CheckValue("startUpOnOff", startUpOnOff, 0)); + VerifyOrReturn(CheckValue("occupancySensorType", occupancySensorType, 0)); NextTest(); } - CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOnTime_6() + CHIP_ERROR TestReadsMandatoryAttributeConstrainsOccupancySensorTypeBitmap_6() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::OccupancySensingClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t onTimeArgument = 0U; - - return cluster.WriteAttributeOnTime(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel(), onTimeArgument); + return cluster.ReadAttributeOccupancySensorTypeBitmap(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); } void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_6(uint16_t onTime) { NextTest(); } - - CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOffWaitTime_7() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint16_t offWaitTimeArgument = 0U; - - return cluster.WriteAttributeOffWaitTime(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), offWaitTimeArgument); - } - - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_7(uint16_t offWaitTime) { NextTest(); } - - CHIP_ERROR TestWriteTheDefaultValueToLtAttributeStartUpOnOff_8() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - uint8_t startUpOnOffArgument = static_cast(0); - - return cluster.WriteAttributeStartUpOnOff(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel(), - startUpOnOffArgument); - } - - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8(uint8_t startUpOnOff) { NextTest(); } - - CHIP_ERROR TestReadsBackLtAttributeOnTime_9() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnTime(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); - } - - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(uint16_t onTime) + void OnSuccessResponse_6(uint8_t occupancySensorTypeBitmap) { - VerifyOrReturn(CheckValue("onTime", onTime, 0U)); + VerifyOrReturn(CheckConstraintType("occupancySensorTypeBitmap", "", "map8")); + VerifyOrReturn(CheckConstraintMinValue("occupancySensorTypeBitmap", occupancySensorTypeBitmap, 1)); + VerifyOrReturn(CheckConstraintMaxValue("occupancySensorTypeBitmap", occupancySensorTypeBitmap, 7)); NextTest(); } - CHIP_ERROR TestReadsBackLtAttributeOffWaitTime_10() + CHIP_ERROR TestWritesTheRespectiveDefaultValueToMandatoryAttributeOccupancySensorTypeBitmap_7() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::OccupancySensingClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOffWaitTime(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + uint8_t occupancySensorTypeBitmapArgument = 1; + + return cluster.WriteAttributeOccupancySensorTypeBitmap(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), + occupancySensorTypeBitmapArgument); } - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_7(uint8_t status) { NextTest(); } - void OnSuccessResponse_10(uint16_t offWaitTime) - { - VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); - NextTest(); - } + void OnSuccessResponse_7(uint8_t occupancySensorTypeBitmap) { ThrowSuccessResponse(); } - CHIP_ERROR TestReadsBackLtAttributeStartUpOnOff_11() + CHIP_ERROR TestReadsBackMandatoryAttributeOccupancySensorTypeBitmap_8() { - chip::Controller::OnOffClusterTest cluster; + chip::Controller::OccupancySensingClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeStartUpOnOff(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); + return cluster.ReadAttributeOccupancySensorTypeBitmap(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel()); } - void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_11(uint8_t startUpOnOff) + void OnSuccessResponse_8(uint8_t occupancySensorTypeBitmap) { - VerifyOrReturn(CheckValue("startUpOnOff", startUpOnOff, 0)); + VerifyOrReturn(CheckValue("occupancySensorTypeBitmap", occupancySensorTypeBitmap, 1)); NextTest(); } }; -class Test_TC_OO_2_2 : public TestCommand +class Test_TC_OO_1_1 : public TestCommand { public: - Test_TC_OO_2_2() : TestCommand("Test_TC_OO_2_2"), mTestIndex(0) {} + Test_TC_OO_1_1() : TestCommand("Test_TC_OO_1_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -12540,12 +12508,12 @@ class Test_TC_OO_2_2 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -12559,60 +12527,29 @@ class Test_TC_OO_2_2 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Send Off Command\n"); - err = TestSendOffCommand_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Send On Command\n"); - err = TestSendOnCommand_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : read the optional global attribute: FeatureMap\n"); + err = TestReadTheOptionalGlobalAttributeFeatureMap_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Send Off Command\n"); - err = TestSendOffCommand_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : write the default values to optional global attribute: FeatureMap\n"); + err = TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Send Toggle Command\n"); - err = TestSendToggleCommand_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is true after toggle command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Send Toggle Command\n"); - err = TestSendToggleCommand_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Check on/off attribute value is false after toggle command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Send On Command\n"); - err = TestSendOnCommand_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is true after on command\n"); - err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Send Off Command\n"); - err = TestSendOffCommand_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Check on/off attribute value is false after off command\n"); - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_13(); + ChipLogProgress(chipTool, " ***** Test Step 5 : reads back optional global attribute: FeatureMap\n"); + err = TestReadsBackOptionalGlobalAttributeFeatureMap_5(); break; } @@ -12625,335 +12562,1033 @@ class Test_TC_OO_2_2 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 14; + const uint16_t mTestCount = 6; + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; - chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; - chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; - chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; - chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; - chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; - chip::Callback::Callback mOnSuccessCallback_13{ OnSuccessCallback_13, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; - static void OnFailureCallback_1(void * context, uint8_t status) + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_1(void * context, bool onOff) + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_1(onOff); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - static void OnFailureCallback_3(void * context, uint8_t status) + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_3(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_3(void * context, bool onOff) + static void OnSuccessCallback_1(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_3(onOff); + (static_cast(context))->OnSuccessResponse_1(clusterRevision); } - static void OnFailureCallback_5(void * context, uint8_t status) + static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_5(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_5(void * context, bool onOff) - { - (static_cast(context))->OnSuccessResponse_5(onOff); - } - - static void OnFailureCallback_7(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_7(status); - } - - static void OnSuccessCallback_7(void * context, bool onOff) + static void OnSuccessCallback_2(void * context, uint16_t clusterRevision) { - (static_cast(context))->OnSuccessResponse_7(onOff); + (static_cast(context))->OnSuccessResponse_2(clusterRevision); } - static void OnFailureCallback_9(void * context, uint8_t status) + static void OnFailureCallback_3(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_9(status); + (static_cast(context))->OnFailureResponse_3(status); } - static void OnSuccessCallback_9(void * context, bool onOff) + static void OnSuccessCallback_3(void * context, uint32_t featureMap) { - (static_cast(context))->OnSuccessResponse_9(onOff); + (static_cast(context))->OnSuccessResponse_3(featureMap); } - static void OnFailureCallback_11(void * context, uint8_t status) + static void OnFailureCallback_4(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_11(status); + (static_cast(context))->OnFailureResponse_4(status); } - static void OnSuccessCallback_11(void * context, bool onOff) + static void OnSuccessCallback_4(void * context, uint32_t featureMap) { - (static_cast(context))->OnSuccessResponse_11(onOff); + (static_cast(context))->OnSuccessResponse_4(featureMap); } - static void OnFailureCallback_13(void * context, uint8_t status) + static void OnFailureCallback_5(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_13(status); + (static_cast(context))->OnFailureResponse_5(status); } - static void OnSuccessCallback_13(void * context, bool onOff) + static void OnSuccessCallback_5(void * context, uint32_t featureMap) { - (static_cast(context))->OnSuccessResponse_13(onOff); + (static_cast(context))->OnSuccessResponse_5(featureMap); } // // Tests methods // - CHIP_ERROR TestSendOffCommand_0() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_0() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - using requestType = chip::app::Clusters::OnOff::Commands::Off::Type; - using responseType = chip::app::DataModel::NullObjectType; - - chip::app::Clusters::OnOff::Commands::Off::Type request; - - auto success = [](void * context, const responseType & data) { - (static_cast(context))->OnSuccessResponse_0(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_0(status); - }; - return cluster.InvokeCommand(request, this, success, failure); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_1() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); - } - - void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_1(bool onOff) + void OnSuccessResponse_0(uint16_t clusterRevision) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 4U)); NextTest(); } - CHIP_ERROR TestSendOnCommand_2() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_1() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - using requestType = chip::app::Clusters::OnOff::Commands::On::Type; - using responseType = chip::app::DataModel::NullObjectType; - - chip::app::Clusters::OnOff::Commands::On::Type request; - - auto success = [](void * context, const responseType & data) { - (static_cast(context))->OnSuccessResponse_2(); - }; + uint16_t clusterRevisionArgument = 3U; - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_2(status); - }; - return cluster.InvokeCommand(request, this, success, failure); + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + clusterRevisionArgument); } - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_1(uint8_t status) { NextTest(); } - void OnSuccessResponse_2() { NextTest(); } + void OnSuccessResponse_1(uint16_t clusterRevision) { ThrowSuccessResponse(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_3() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_2() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + return cluster.ReadAttributeClusterRevision(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); } - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_3(bool onOff) + void OnSuccessResponse_2(uint16_t clusterRevision) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 4U)); NextTest(); } - CHIP_ERROR TestSendOffCommand_4() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - using requestType = chip::app::Clusters::OnOff::Commands::Off::Type; - using responseType = chip::app::DataModel::NullObjectType; - - chip::app::Clusters::OnOff::Commands::Off::Type request; - - auto success = [](void * context, const responseType & data) { - (static_cast(context))->OnSuccessResponse_4(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_4(status); - }; - return cluster.InvokeCommand(request, this, success, failure); - } - - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_4() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + CHIP_ERROR TestReadTheOptionalGlobalAttributeFeatureMap_3() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + return cluster.ReadAttributeFeatureMap(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); } - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_5(bool onOff) + void OnSuccessResponse_3(uint32_t featureMap) { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); + VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); NextTest(); } - CHIP_ERROR TestSendToggleCommand_6() + CHIP_ERROR TestWriteTheDefaultValuesToOptionalGlobalAttributeFeatureMap_4() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - using requestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; - using responseType = chip::app::DataModel::NullObjectType; - - chip::app::Clusters::OnOff::Commands::Toggle::Type request; - - auto success = [](void * context, const responseType & data) { - (static_cast(context))->OnSuccessResponse_6(); - }; + uint32_t featureMapArgument = 0UL; - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_6(status); - }; - return cluster.InvokeCommand(request, this, success, failure); + return cluster.WriteAttributeFeatureMap(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel(), featureMapArgument); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_4(uint8_t status) { NextTest(); } - void OnSuccessResponse_6() { NextTest(); } + void OnSuccessResponse_4(uint32_t featureMap) { ThrowSuccessResponse(); } - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_7() + CHIP_ERROR TestReadsBackOptionalGlobalAttributeFeatureMap_5() { chip::Controller::OnOffClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + return cluster.ReadAttributeFeatureMap(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_7(bool onOff) + void OnSuccessResponse_5(uint32_t featureMap) { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); + VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); NextTest(); } +}; - CHIP_ERROR TestSendToggleCommand_8() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - using requestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; - using responseType = chip::app::DataModel::NullObjectType; - - chip::app::Clusters::OnOff::Commands::Toggle::Type request; - - auto success = [](void * context, const responseType & data) { - (static_cast(context))->OnSuccessResponse_8(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_8(status); - }; - return cluster.InvokeCommand(request, this, success, failure); - } - - void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_8() { NextTest(); } - - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_9() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeOnOff(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); - } - - void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_9(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 0)); - NextTest(); - } +class Test_TC_OO_2_1 : public TestCommand +{ +public: + Test_TC_OO_2_1() : TestCommand("Test_TC_OO_2_1"), mTestIndex(0) {} - CHIP_ERROR TestSendOnCommand_10() + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); - - using requestType = chip::app::Clusters::OnOff::Commands::On::Type; - using responseType = chip::app::DataModel::NullObjectType; - - chip::app::Clusters::OnOff::Commands::On::Type request; - - auto success = [](void * context, const responseType & data) { - (static_cast(context))->OnSuccessResponse_10(); - }; - - auto failure = [](void * context, EmberAfStatus status) { - (static_cast(context))->OnFailureResponse_10(status); - }; - return cluster.InvokeCommand(request, this, success, failure); - } - - void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_10() { NextTest(); } + CHIP_ERROR err = CHIP_NO_ERROR; - CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_11() - { - chip::Controller::OnOffClusterTest cluster; - cluster.Associate(mDevice, 1); + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_1\n"); + } - return cluster.ReadAttributeOnOff(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); - } + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + Wait(); - void OnSuccessResponse_11(bool onOff) - { - VerifyOrReturn(CheckValue("onOff", onOff, 1)); - NextTest(); + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: OnOff\n"); + err = TestReadTheMandatoryAttributeOnOff_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : reads back mandatory attribute: OnOff\n"); + err = TestReadsBackMandatoryAttributeOnOff_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : read LT attribute: GlobalSceneControl\n"); + err = TestReadLtAttributeGlobalSceneControl_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read LT attribute: OnTime\n"); + err = TestReadLtAttributeOnTime_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read LT attribute: OffWaitTime\n"); + err = TestReadLtAttributeOffWaitTime_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read LT attribute: StartUpOnOff\n"); + err = TestReadLtAttributeStartUpOnOff_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : write the default value to LT attribute: OnTime\n"); + err = TestWriteTheDefaultValueToLtAttributeOnTime_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : write the default value to LT attribute: OffWaitTime\n"); + err = TestWriteTheDefaultValueToLtAttributeOffWaitTime_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : write the default value to LT attribute: StartUpOnOff\n"); + err = TestWriteTheDefaultValueToLtAttributeStartUpOnOff_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : reads back LT attribute: OnTime\n"); + err = TestReadsBackLtAttributeOnTime_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : reads back LT attribute: OffWaitTime\n"); + err = TestReadsBackLtAttributeOffWaitTime_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : reads back LT attribute: StartUpOnOff\n"); + err = TestReadsBackLtAttributeStartUpOnOff_11(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 12; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnFailureCallback_8{ OnFailureCallback_8, this }; + chip::Callback::Callback mOnSuccessCallback_8{ OnSuccessCallback_8, this }; + chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; + chip::Callback::Callback mOnFailureCallback_10{ OnFailureCallback_10, this }; + chip::Callback::Callback mOnSuccessCallback_10{ OnSuccessCallback_10, this }; + chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; + chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_0(onOff); + } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_1(onOff); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, bool globalSceneControl) + { + (static_cast(context))->OnSuccessResponse_2(globalSceneControl); + } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, uint16_t onTime) + { + (static_cast(context))->OnSuccessResponse_3(onTime); + } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, uint16_t offWaitTime) + { + (static_cast(context))->OnSuccessResponse_4(offWaitTime); + } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, uint8_t startUpOnOff) + { + (static_cast(context))->OnSuccessResponse_5(startUpOnOff); + } + + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } + + static void OnSuccessCallback_6(void * context, uint16_t onTime) + { + (static_cast(context))->OnSuccessResponse_6(onTime); + } + + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } + + static void OnSuccessCallback_7(void * context, uint16_t offWaitTime) + { + (static_cast(context))->OnSuccessResponse_7(offWaitTime); + } + + static void OnFailureCallback_8(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_8(status); + } + + static void OnSuccessCallback_8(void * context, uint8_t startUpOnOff) + { + (static_cast(context))->OnSuccessResponse_8(startUpOnOff); + } + + static void OnFailureCallback_9(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_9(status); + } + + static void OnSuccessCallback_9(void * context, uint16_t onTime) + { + (static_cast(context))->OnSuccessResponse_9(onTime); + } + + static void OnFailureCallback_10(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_10(status); + } + + static void OnSuccessCallback_10(void * context, uint16_t offWaitTime) + { + (static_cast(context))->OnSuccessResponse_10(offWaitTime); + } + + static void OnFailureCallback_11(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_11(status); + } + + static void OnSuccessCallback_11(void * context, uint8_t startUpOnOff) + { + (static_cast(context))->OnSuccessResponse_11(startUpOnOff); + } + + // + // Tests methods + // + + CHIP_ERROR TestReadTheMandatoryAttributeOnOff_0() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } + + CHIP_ERROR TestReadsBackMandatoryAttributeOnOff_1() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } + + CHIP_ERROR TestReadLtAttributeGlobalSceneControl_2() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeGlobalSceneControl(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(bool globalSceneControl) + { + VerifyOrReturn(CheckValue("globalSceneControl", globalSceneControl, 1)); + NextTest(); + } + + CHIP_ERROR TestReadLtAttributeOnTime_3() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnTime(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint16_t onTime) + { + VerifyOrReturn(CheckValue("onTime", onTime, 0U)); + NextTest(); + } + + CHIP_ERROR TestReadLtAttributeOffWaitTime_4() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOffWaitTime(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(uint16_t offWaitTime) + { + VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); + NextTest(); + } + + CHIP_ERROR TestReadLtAttributeStartUpOnOff_5() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeStartUpOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(uint8_t startUpOnOff) + { + VerifyOrReturn(CheckValue("startUpOnOff", startUpOnOff, 0)); + NextTest(); + } + + CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOnTime_6() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t onTimeArgument = 0U; + + return cluster.WriteAttributeOnTime(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel(), onTimeArgument); + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6(uint16_t onTime) { NextTest(); } + + CHIP_ERROR TestWriteTheDefaultValueToLtAttributeOffWaitTime_7() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t offWaitTimeArgument = 0U; + + return cluster.WriteAttributeOffWaitTime(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel(), offWaitTimeArgument); + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(uint16_t offWaitTime) { NextTest(); } + + CHIP_ERROR TestWriteTheDefaultValueToLtAttributeStartUpOnOff_8() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t startUpOnOffArgument = static_cast(0); + + return cluster.WriteAttributeStartUpOnOff(mOnSuccessCallback_8.Cancel(), mOnFailureCallback_8.Cancel(), + startUpOnOffArgument); + } + + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_8(uint8_t startUpOnOff) { NextTest(); } + + CHIP_ERROR TestReadsBackLtAttributeOnTime_9() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnTime(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); + } + + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_9(uint16_t onTime) + { + VerifyOrReturn(CheckValue("onTime", onTime, 0U)); + NextTest(); + } + + CHIP_ERROR TestReadsBackLtAttributeOffWaitTime_10() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOffWaitTime(mOnSuccessCallback_10.Cancel(), mOnFailureCallback_10.Cancel()); + } + + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_10(uint16_t offWaitTime) + { + VerifyOrReturn(CheckValue("offWaitTime", offWaitTime, 0U)); + NextTest(); + } + + CHIP_ERROR TestReadsBackLtAttributeStartUpOnOff_11() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeStartUpOnOff(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); + } + + void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_11(uint8_t startUpOnOff) + { + VerifyOrReturn(CheckValue("startUpOnOff", startUpOnOff, 0)); + NextTest(); + } +}; + +class Test_TC_OO_2_2 : public TestCommand +{ +public: + Test_TC_OO_2_2() : TestCommand("Test_TC_OO_2_2"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OO_2_2\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OO_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Send Off Command\n"); + err = TestSendOffCommand_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Send On Command\n"); + err = TestSendOnCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Send Off Command\n"); + err = TestSendOffCommand_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Send Toggle Command\n"); + err = TestSendToggleCommand_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Check on/off attribute value is true after toggle command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Send Toggle Command\n"); + err = TestSendToggleCommand_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Check on/off attribute value is false after toggle command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Send On Command\n"); + err = TestSendOnCommand_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Check on/off attribute value is true after on command\n"); + err = TestCheckOnOffAttributeValueIsTrueAfterOnCommand_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Send Off Command\n"); + err = TestSendOffCommand_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Check on/off attribute value is false after off command\n"); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_13(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 14; + + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnFailureCallback_9{ OnFailureCallback_9, this }; + chip::Callback::Callback mOnSuccessCallback_9{ OnSuccessCallback_9, this }; + chip::Callback::Callback mOnFailureCallback_11{ OnFailureCallback_11, this }; + chip::Callback::Callback mOnSuccessCallback_11{ OnSuccessCallback_11, this }; + chip::Callback::Callback mOnFailureCallback_13{ OnFailureCallback_13, this }; + chip::Callback::Callback mOnSuccessCallback_13{ OnSuccessCallback_13, this }; + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_1(onOff); + } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_3(onOff); + } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_5(onOff); + } + + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } + + static void OnSuccessCallback_7(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_7(onOff); + } + + static void OnFailureCallback_9(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_9(status); + } + + static void OnSuccessCallback_9(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_9(onOff); + } + + static void OnFailureCallback_11(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_11(status); + } + + static void OnSuccessCallback_11(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_11(onOff); + } + + static void OnFailureCallback_13(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_13(status); + } + + static void OnSuccessCallback_13(void * context, bool onOff) + { + (static_cast(context))->OnSuccessResponse_13(onOff); + } + + // + // Tests methods + // + + CHIP_ERROR TestSendOffCommand_0() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + using requestType = chip::app::Clusters::OnOff::Commands::Off::Type; + using responseType = chip::app::DataModel::NullObjectType; + + chip::app::Clusters::OnOff::Commands::Off::Type request; + + auto success = [](void * context, const responseType & data) { + (static_cast(context))->OnSuccessResponse_0(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_0(status); + }; + return cluster.InvokeCommand(request, this, success, failure); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_1() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } + + CHIP_ERROR TestSendOnCommand_2() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + using requestType = chip::app::Clusters::OnOff::Commands::On::Type; + using responseType = chip::app::DataModel::NullObjectType; + + chip::app::Clusters::OnOff::Commands::On::Type request; + + auto success = [](void * context, const responseType & data) { + (static_cast(context))->OnSuccessResponse_2(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_2(status); + }; + return cluster.InvokeCommand(request, this, success, failure); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_3() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } + + CHIP_ERROR TestSendOffCommand_4() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + using requestType = chip::app::Clusters::OnOff::Commands::Off::Type; + using responseType = chip::app::DataModel::NullObjectType; + + chip::app::Clusters::OnOff::Commands::Off::Type request; + + auto success = [](void * context, const responseType & data) { + (static_cast(context))->OnSuccessResponse_4(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_4(status); + }; + return cluster.InvokeCommand(request, this, success, failure); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_5() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } + + CHIP_ERROR TestSendToggleCommand_6() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + using requestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; + using responseType = chip::app::DataModel::NullObjectType; + + chip::app::Clusters::OnOff::Commands::Toggle::Type request; + + auto success = [](void * context, const responseType & data) { + (static_cast(context))->OnSuccessResponse_6(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_6(status); + }; + return cluster.InvokeCommand(request, this, success, failure); + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterToggleCommand_7() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); + } + + CHIP_ERROR TestSendToggleCommand_8() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + using requestType = chip::app::Clusters::OnOff::Commands::Toggle::Type; + using responseType = chip::app::DataModel::NullObjectType; + + chip::app::Clusters::OnOff::Commands::Toggle::Type request; + + auto success = [](void * context, const responseType & data) { + (static_cast(context))->OnSuccessResponse_8(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_8(status); + }; + return cluster.InvokeCommand(request, this, success, failure); + } + + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_8() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterToggleCommand_9() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_9.Cancel(), mOnFailureCallback_9.Cancel()); + } + + void OnFailureResponse_9(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_9(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 0)); + NextTest(); + } + + CHIP_ERROR TestSendOnCommand_10() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + using requestType = chip::app::Clusters::OnOff::Commands::On::Type; + using responseType = chip::app::DataModel::NullObjectType; + + chip::app::Clusters::OnOff::Commands::On::Type request; + + auto success = [](void * context, const responseType & data) { + (static_cast(context))->OnSuccessResponse_10(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_10(status); + }; + return cluster.InvokeCommand(request, this, success, failure); + } + + void OnFailureResponse_10(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_10() { NextTest(); } + + CHIP_ERROR TestCheckOnOffAttributeValueIsTrueAfterOnCommand_11() + { + chip::Controller::OnOffClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeOnOff(mOnSuccessCallback_11.Cancel(), mOnFailureCallback_11.Cancel()); + } + + void OnFailureResponse_11(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_11(bool onOff) + { + VerifyOrReturn(CheckValue("onOff", onOff, 1)); + NextTest(); } CHIP_ERROR TestSendOffCommand_12() @@ -13000,7 +13635,88 @@ class Test_TC_OO_2_2 : public TestCommand class Test_TC_PCC_1_1 : public TestCommand { public: - Test_TC_PCC_1_1() : TestCommand("Test_TC_PCC_1_1"), mTestIndex(0) {} + Test_TC_PCC_1_1() : TestCommand("Test_TC_PCC_1_1"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_1_1\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + + static void OnFailureCallback_0(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_0(status); + } + + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + { + (static_cast(context))->OnSuccessResponse_0(clusterRevision); + } + + // + // Tests methods + // + + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint16_t clusterRevisionArgument = 3U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); + } + + void OnFailureResponse_0(uint8_t status) { NextTest(); } + + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } +}; + +class Test_TC_PCC_2_1 : public TestCommand +{ +public: + Test_TC_PCC_2_1() : TestCommand("Test_TC_PCC_2_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -13009,12 +13725,12 @@ class Test_TC_PCC_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -13028,9 +13744,36 @@ class Test_TC_PCC_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_7(); break; } @@ -13043,45 +13786,246 @@ class Test_TC_PCC_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + const uint16_t mTestCount = 8; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, + this }; + chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, + this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; + chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; + chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, + this }; + chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; + chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, + this }; + chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_0(void * context, int16_t maxPressure) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnSuccessResponse_0(maxPressure); + } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint8_t effectiveOperationMode) + { + (static_cast(context))->OnSuccessResponse_1(effectiveOperationMode); + } + + static void OnFailureCallback_2(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_2(status); + } + + static void OnSuccessCallback_2(void * context, uint8_t effectiveControlMode) + { + (static_cast(context))->OnSuccessResponse_2(effectiveControlMode); + } + + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, int16_t capacity) + { + (static_cast(context))->OnSuccessResponse_3(capacity); + } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, int16_t maxPressure) + { + (static_cast(context))->OnSuccessResponse_4(maxPressure); + } + + static void OnFailureCallback_5(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_5(status); + } + + static void OnSuccessCallback_5(void * context, uint8_t effectiveOperationMode) + { + (static_cast(context))->OnSuccessResponse_5(effectiveOperationMode); + } + + static void OnFailureCallback_6(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_6(status); + } + + static void OnSuccessCallback_6(void * context, uint8_t effectiveControlMode) + { + (static_cast(context))->OnSuccessResponse_6(effectiveControlMode); + } + + static void OnFailureCallback_7(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_7(status); + } + + static void OnSuccessCallback_7(void * context, int16_t capacity) + { + (static_cast(context))->OnSuccessResponse_7(capacity); } // // Tests methods // - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_0() { chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 3U; + return cluster.ReadAttributeMaxPressure(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(int16_t maxPressure) + { + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + NextTest(); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_1() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEffectiveOperationMode(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint8_t effectiveOperationMode) + { + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_2() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEffectiveControlMode(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); + } + + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint8_t effectiveControlMode) + { + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_3() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeCapacity(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(int16_t capacity) + { + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_4() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeMaxPressure(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(int16_t maxPressure) + { + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_5() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEffectiveOperationMode(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); + } + + void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_5(uint8_t effectiveOperationMode) + { + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_6() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeEffectiveControlMode(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + } + + void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_6(uint8_t effectiveControlMode) + { + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); + NextTest(); + } + + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_7() + { + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeCapacity(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } + void OnSuccessResponse_7(int16_t capacity) + { + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + NextTest(); + } }; -class Test_TC_PCC_2_1 : public TestCommand +class Test_TC_PCC_2_2 : public TestCommand { public: - Test_TC_PCC_2_1() : TestCommand("Test_TC_PCC_2_1"), mTestIndex(0) {} + Test_TC_PCC_2_2() : TestCommand("Test_TC_PCC_2_2"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -13090,12 +14034,12 @@ class Test_TC_PCC_2_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -13109,36 +14053,16 @@ class Test_TC_PCC_2_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : read the mandatory attribute: MaxPressure\n"); - err = TestReadTheMandatoryAttributeMaxPressure_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Write 1 to the OperationMode attribute to DUT: OperationMode\n"); + err = TestWrite1ToTheOperationModeAttributeToDutOperationMode_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: EffectiveOperationMode\n"); - err = TestReadTheMandatoryAttributeEffectiveOperationMode_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Write 2 to the OperationMode attribute to DUT: OperationMode\n"); + err = TestWrite2ToTheOperationModeAttributeToDutOperationMode_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: EffectiveControlMode\n"); - err = TestReadTheMandatoryAttributeEffectiveControlMode_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: Capacity\n"); - err = TestReadTheMandatoryAttributeCapacity_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: MaxPressure\n"); - err = TestReadTheMandatoryAttributeMaxPressure_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: EffectiveOperationMode\n"); - err = TestReadTheMandatoryAttributeEffectiveOperationMode_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: EffectiveControlMode\n"); - err = TestReadTheMandatoryAttributeEffectiveControlMode_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: Capacity\n"); - err = TestReadTheMandatoryAttributeCapacity_7(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Write 3 to the OperationMode attribute to DUT: OperationMode\n"); + err = TestWrite3ToTheOperationModeAttributeToDutOperationMode_2(); break; } @@ -13151,130 +14075,192 @@ class Test_TC_PCC_2_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + const uint16_t mTestCount = 3; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; - chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, - this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; - chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, - this }; - chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; - chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; - chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; - chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; - chip::Callback::Callback mOnFailureCallback_5{ OnFailureCallback_5, this }; - chip::Callback::Callback mOnSuccessCallback_5{ OnSuccessCallback_5, - this }; - chip::Callback::Callback mOnFailureCallback_6{ OnFailureCallback_6, this }; - chip::Callback::Callback mOnSuccessCallback_6{ OnSuccessCallback_6, - this }; - chip::Callback::Callback mOnFailureCallback_7{ OnFailureCallback_7, this }; - chip::Callback::Callback mOnSuccessCallback_7{ OnSuccessCallback_7, this }; + chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, int16_t maxPressure) + static void OnSuccessCallback_0(void * context, uint8_t operationMode) { - (static_cast(context))->OnSuccessResponse_0(maxPressure); + (static_cast(context))->OnSuccessResponse_0(operationMode); } static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_1(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_1(void * context, uint8_t effectiveOperationMode) + static void OnSuccessCallback_1(void * context, uint8_t operationMode) { - (static_cast(context))->OnSuccessResponse_1(effectiveOperationMode); + (static_cast(context))->OnSuccessResponse_1(operationMode); } static void OnFailureCallback_2(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_2(status); + (static_cast(context))->OnFailureResponse_2(status); } - static void OnSuccessCallback_2(void * context, uint8_t effectiveControlMode) + static void OnSuccessCallback_2(void * context, uint8_t operationMode) { - (static_cast(context))->OnSuccessResponse_2(effectiveControlMode); + (static_cast(context))->OnSuccessResponse_2(operationMode); } - static void OnFailureCallback_3(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_3(status); - } + // + // Tests methods + // - static void OnSuccessCallback_3(void * context, int16_t capacity) + CHIP_ERROR TestWrite1ToTheOperationModeAttributeToDutOperationMode_0() { - (static_cast(context))->OnSuccessResponse_3(capacity); - } + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); - static void OnFailureCallback_4(void * context, uint8_t status) - { - (static_cast(context))->OnFailureResponse_4(status); + uint8_t operationModeArgument = static_cast(1); + + return cluster.WriteAttributeOperationMode(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + operationModeArgument); } - static void OnSuccessCallback_4(void * context, int16_t maxPressure) + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(uint8_t operationMode) { NextTest(); } + + CHIP_ERROR TestWrite2ToTheOperationModeAttributeToDutOperationMode_1() { - (static_cast(context))->OnSuccessResponse_4(maxPressure); + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t operationModeArgument = static_cast(2); + + return cluster.WriteAttributeOperationMode(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel(), + operationModeArgument); } - static void OnFailureCallback_5(void * context, uint8_t status) + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint8_t operationMode) { NextTest(); } + + CHIP_ERROR TestWrite3ToTheOperationModeAttributeToDutOperationMode_2() { - (static_cast(context))->OnFailureResponse_5(status); + chip::Controller::PumpConfigurationAndControlClusterTest cluster; + cluster.Associate(mDevice, 1); + + uint8_t operationModeArgument = static_cast(3); + + return cluster.WriteAttributeOperationMode(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel(), + operationModeArgument); } - static void OnSuccessCallback_5(void * context, uint8_t effectiveOperationMode) + void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_2(uint8_t operationMode) { NextTest(); } +}; + +class Test_TC_PCC_2_3 : public TestCommand +{ +public: + Test_TC_PCC_2_3() : TestCommand("Test_TC_PCC_2_3"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override { - (static_cast(context))->OnSuccessResponse_5(effectiveOperationMode); + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_3\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Write 0 to the OperationMode attribute to DUT\n"); + err = TestWrite0ToTheOperationModeAttributeToDut_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads the attribute: EffectiveOperationMode\n"); + err = TestReadsTheAttributeEffectiveOperationMode_1(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - static void OnFailureCallback_6(void * context, uint8_t status) +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; + + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, + this }; + + static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_6(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_6(void * context, uint8_t effectiveControlMode) + static void OnSuccessCallback_0(void * context, uint8_t operationMode) { - (static_cast(context))->OnSuccessResponse_6(effectiveControlMode); + (static_cast(context))->OnSuccessResponse_0(operationMode); } - static void OnFailureCallback_7(void * context, uint8_t status) + static void OnFailureCallback_1(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_7(status); + (static_cast(context))->OnFailureResponse_1(status); } - static void OnSuccessCallback_7(void * context, int16_t capacity) + static void OnSuccessCallback_1(void * context, uint8_t effectiveOperationMode) { - (static_cast(context))->OnSuccessResponse_7(capacity); + (static_cast(context))->OnSuccessResponse_1(effectiveOperationMode); } // // Tests methods // - CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_0() + CHIP_ERROR TestWrite0ToTheOperationModeAttributeToDut_0() { chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeMaxPressure(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + uint8_t operationModeArgument = static_cast(0); + + return cluster.WriteAttributeOperationMode(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + operationModeArgument); } void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } - void OnSuccessResponse_0(int16_t maxPressure) - { - VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); - NextTest(); - } + void OnSuccessResponse_0(uint8_t operationMode) { NextTest(); } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_1() + CHIP_ERROR TestReadsTheAttributeEffectiveOperationMode_1() { chip::Controller::PumpConfigurationAndControlClusterTest cluster; cluster.Associate(mDevice, 1); @@ -13286,111 +14272,96 @@ class Test_TC_PCC_2_1 : public TestCommand void OnSuccessResponse_1(uint8_t effectiveOperationMode) { - VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + VerifyOrReturn(CheckValue("effectiveOperationMode", effectiveOperationMode, 0)); NextTest(); } +}; - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_2() - { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeEffectiveControlMode(mOnSuccessCallback_2.Cancel(), mOnFailureCallback_2.Cancel()); - } - - void OnFailureResponse_2(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_2(uint8_t effectiveControlMode) - { - VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); - NextTest(); - } +class Test_TC_RH_1_1 : public TestCommand +{ +public: + Test_TC_RH_1_1() : TestCommand("Test_TC_RH_1_1"), mTestIndex(0) {} - CHIP_ERROR TestReadTheMandatoryAttributeCapacity_3() + /////////// TestCommand Interface ///////// + void NextTest() override { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeCapacity(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); - } - - void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + CHIP_ERROR err = CHIP_NO_ERROR; - void OnSuccessResponse_3(int16_t capacity) - { - VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); - NextTest(); - } + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_1_1\n"); + } - CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_4() - { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - return cluster.ReadAttributeMaxPressure(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); - } + Wait(); - void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, + " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + break; + } - void OnSuccessResponse_4(int16_t maxPressure) - { - VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); - NextTest(); + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_5() - { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeEffectiveOperationMode(mOnSuccessCallback_5.Cancel(), mOnFailureCallback_5.Cancel()); - } +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; - void OnFailureResponse_5(uint8_t status) { ThrowFailureResponse(); } + chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; - void OnSuccessResponse_5(uint8_t effectiveOperationMode) + static void OnFailureCallback_0(void * context, uint8_t status) { - VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); - NextTest(); + (static_cast(context))->OnFailureResponse_0(status); } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_6() + static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; - cluster.Associate(mDevice, 1); - - return cluster.ReadAttributeEffectiveControlMode(mOnSuccessCallback_6.Cancel(), mOnFailureCallback_6.Cancel()); + (static_cast(context))->OnSuccessResponse_0(clusterRevision); } - void OnFailureResponse_6(uint8_t status) { ThrowFailureResponse(); } - - void OnSuccessResponse_6(uint8_t effectiveControlMode) - { - VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); - NextTest(); - } + // + // Tests methods + // - CHIP_ERROR TestReadTheMandatoryAttributeCapacity_7() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() { - chip::Controller::PumpConfigurationAndControlClusterTest cluster; + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; cluster.Associate(mDevice, 1); - return cluster.ReadAttributeCapacity(mOnSuccessCallback_7.Cancel(), mOnFailureCallback_7.Cancel()); + uint16_t clusterRevisionArgument = 1U; + + return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), + clusterRevisionArgument); } - void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + void OnFailureResponse_0(uint8_t status) { NextTest(); } - void OnSuccessResponse_7(int16_t capacity) - { - VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); - NextTest(); - } + void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } }; -class Test_TC_RH_1_1 : public TestCommand +class Test_TC_RH_2_1 : public TestCommand { public: - Test_TC_RH_1_1() : TestCommand("Test_TC_RH_1_1"), mTestIndex(0) {} + Test_TC_RH_2_1() : TestCommand("Test_TC_RH_2_1"), mTestIndex(0) {} /////////// TestCommand Interface ///////// void NextTest() override @@ -13399,12 +14370,12 @@ class Test_TC_RH_1_1 : public TestCommand if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_RH_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RH_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -13418,9 +14389,12 @@ class Test_TC_RH_1_1 : public TestCommand switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, - " ***** Test Step 0 : write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Reads constraints of attribute: MeasuredValue\n"); + err = TestReadsConstraintsOfAttributeMeasuredValue_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Reads constraints of attribute: MinMeasuredValue\n"); + err = TestReadsConstraintsOfAttributeMinMeasuredValue_1(); break; } @@ -13433,39 +14407,69 @@ class Test_TC_RH_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 1; + const uint16_t mTestCount = 2; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; - chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; + chip::Callback::Callback mOnFailureCallback_1{ OnFailureCallback_1, this }; + chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; static void OnFailureCallback_0(void * context, uint8_t status) { - (static_cast(context))->OnFailureResponse_0(status); + (static_cast(context))->OnFailureResponse_0(status); } - static void OnSuccessCallback_0(void * context, uint16_t clusterRevision) + static void OnSuccessCallback_0(void * context, uint16_t measuredValue) { - (static_cast(context))->OnSuccessResponse_0(clusterRevision); + (static_cast(context))->OnSuccessResponse_0(measuredValue); + } + + static void OnFailureCallback_1(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_1(status); + } + + static void OnSuccessCallback_1(void * context, uint16_t minMeasuredValue) + { + (static_cast(context))->OnSuccessResponse_1(minMeasuredValue); } // // Tests methods // - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_0() + CHIP_ERROR TestReadsConstraintsOfAttributeMeasuredValue_0() { chip::Controller::RelativeHumidityMeasurementClusterTest cluster; cluster.Associate(mDevice, 1); - uint16_t clusterRevisionArgument = 1U; + return cluster.ReadAttributeMeasuredValue(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel()); + } - return cluster.WriteAttributeClusterRevision(mOnSuccessCallback_0.Cancel(), mOnFailureCallback_0.Cancel(), - clusterRevisionArgument); + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0(uint16_t measuredValue) + { + VerifyOrReturn(CheckConstraintType("measuredValue", "", "uint16")); + NextTest(); } - void OnFailureResponse_0(uint8_t status) { NextTest(); } + CHIP_ERROR TestReadsConstraintsOfAttributeMinMeasuredValue_1() + { + chip::Controller::RelativeHumidityMeasurementClusterTest cluster; + cluster.Associate(mDevice, 1); - void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } + return cluster.ReadAttributeMinMeasuredValue(mOnSuccessCallback_1.Cancel(), mOnFailureCallback_1.Cancel()); + } + + void OnFailureResponse_1(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_1(uint16_t minMeasuredValue) + { + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "uint16")); + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", minMeasuredValue, 9999)); + NextTest(); + } }; class Test_TC_TM_1_1 : public TestCommand @@ -14585,6 +15589,14 @@ class Test_TC_WNCV_1_1 : public TestCommand ChipLogProgress(chipTool, " ***** Test Step 2 : reads back global attribute: ClusterRevision\n"); err = TestReadsBackGlobalAttributeClusterRevision_2(); break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the global attribute: FeatureMap\n"); + err = TestReadTheGlobalAttributeFeatureMap_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : reads back global attribute: FeatureMap\n"); + err = TestReadsBackGlobalAttributeFeatureMap_4(); + break; } if (CHIP_NO_ERROR != err) @@ -14596,7 +15608,7 @@ class Test_TC_WNCV_1_1 : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 3; + const uint16_t mTestCount = 5; chip::Callback::Callback mOnFailureCallback_0{ OnFailureCallback_0, this }; chip::Callback::Callback mOnSuccessCallback_0{ OnSuccessCallback_0, this }; @@ -14604,6 +15616,10 @@ class Test_TC_WNCV_1_1 : public TestCommand chip::Callback::Callback mOnSuccessCallback_1{ OnSuccessCallback_1, this }; chip::Callback::Callback mOnFailureCallback_2{ OnFailureCallback_2, this }; chip::Callback::Callback mOnSuccessCallback_2{ OnSuccessCallback_2, this }; + chip::Callback::Callback mOnFailureCallback_3{ OnFailureCallback_3, this }; + chip::Callback::Callback mOnSuccessCallback_3{ OnSuccessCallback_3, this }; + chip::Callback::Callback mOnFailureCallback_4{ OnFailureCallback_4, this }; + chip::Callback::Callback mOnSuccessCallback_4{ OnSuccessCallback_4, this }; static void OnFailureCallback_0(void * context, uint8_t status) { @@ -14635,6 +15651,26 @@ class Test_TC_WNCV_1_1 : public TestCommand (static_cast(context))->OnSuccessResponse_2(clusterRevision); } + static void OnFailureCallback_3(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_3(status); + } + + static void OnSuccessCallback_3(void * context, uint32_t featureMap) + { + (static_cast(context))->OnSuccessResponse_3(featureMap); + } + + static void OnFailureCallback_4(void * context, uint8_t status) + { + (static_cast(context))->OnFailureResponse_4(status); + } + + static void OnSuccessCallback_4(void * context, uint32_t featureMap) + { + (static_cast(context))->OnSuccessResponse_4(featureMap); + } + // // Tests methods // @@ -14685,6 +15721,38 @@ class Test_TC_WNCV_1_1 : public TestCommand VerifyOrReturn(CheckValue("clusterRevision", clusterRevision, 5U)); NextTest(); } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_3() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeFeatureMap(mOnSuccessCallback_3.Cancel(), mOnFailureCallback_3.Cancel()); + } + + void OnFailureResponse_3(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_3(uint32_t featureMap) + { + VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); + NextTest(); + } + + CHIP_ERROR TestReadsBackGlobalAttributeFeatureMap_4() + { + chip::Controller::WindowCoveringClusterTest cluster; + cluster.Associate(mDevice, 1); + + return cluster.ReadAttributeFeatureMap(mOnSuccessCallback_4.Cancel(), mOnFailureCallback_4.Cancel()); + } + + void OnFailureResponse_4(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_4(uint32_t featureMap) + { + VerifyOrReturn(CheckValue("featureMap", featureMap, 0UL)); + NextTest(); + } }; class Test_TC_WNCV_2_1 : public TestCommand @@ -21388,6 +22456,14 @@ class TestClusterComplexTypes : public TestCommand " ***** Test Step 6 : Send Test Command With List of Struct Argument and arg1.b of first item is false\n"); err = TestSendTestCommandWithListOfStructArgumentAndArg1bOfFirstItemIsFalse_6(); break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Send Test Command with optional arg set.\n"); + err = TestSendTestCommandWithOptionalArgSet_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Send Test Command without its optional arg.\n"); + err = TestSendTestCommandWithoutItsOptionalArg_8(); + break; } if (CHIP_NO_ERROR != err) @@ -21399,7 +22475,7 @@ class TestClusterComplexTypes : public TestCommand private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 9; // // Tests methods @@ -21663,6 +22739,70 @@ class TestClusterComplexTypes : public TestCommand void OnFailureResponse_6(uint8_t status) { NextTest(); } void OnSuccessResponse_6() { ThrowSuccessResponse(); } + + CHIP_ERROR TestSendTestCommandWithOptionalArgSet_7() + { + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + using requestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; + using responseType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalResponse::DecodableType; + + chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type request; + request.arg1.Emplace().SetNonNull() = 5; + + auto success = [](void * context, const responseType & data) { + (static_cast(context))->OnSuccessResponse_7(data.wasPresent, data.wasNull, data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_7(status); + }; + return cluster.InvokeCommand(request, this, success, failure); + } + + void OnFailureResponse_7(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_7(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value) + { + VerifyOrReturn(CheckValue("wasPresent", wasPresent, true)); + + VerifyOrReturn(CheckValuePresent("wasNull", wasNull)); + VerifyOrReturn(CheckValue("wasNull.Value()", wasNull.Value(), false)); + + VerifyOrReturn(CheckValuePresent("value", value)); + VerifyOrReturn(CheckValue("value.Value()", value.Value(), 5)); + NextTest(); + } + + CHIP_ERROR TestSendTestCommandWithoutItsOptionalArg_8() + { + chip::Controller::TestClusterClusterTest cluster; + cluster.Associate(mDevice, 1); + + using requestType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type; + using responseType = chip::app::Clusters::TestCluster::Commands::TestNullableOptionalResponse::DecodableType; + + chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type request; + + auto success = [](void * context, const responseType & data) { + (static_cast(context))->OnSuccessResponse_8(data.wasPresent, data.wasNull, data.value); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_8(status); + }; + return cluster.InvokeCommand(request, this, success, failure); + } + + void OnFailureResponse_8(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_8(bool wasPresent, const chip::Optional & wasNull, const chip::Optional & value) + { + VerifyOrReturn(CheckValue("wasPresent", wasPresent, false)); + + NextTest(); + } }; class TestConstraints : public TestCommand @@ -22307,6 +23447,83 @@ class TestBasicInformation : public TestCommand void OnSuccessResponse_3(chip::CharSpan location) { NextTest(); } }; +class TestIdentifyCluster : public TestCommand +{ +public: + TestIdentifyCluster() : TestCommand("TestIdentifyCluster"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TestIdentifyCluster\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TestIdentifyCluster\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Send Identify command and expect success response\n"); + err = TestSendIdentifyCommandAndExpectSuccessResponse_0(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 1; + + // + // Tests methods + // + + CHIP_ERROR TestSendIdentifyCommandAndExpectSuccessResponse_0() + { + chip::Controller::IdentifyClusterTest cluster; + cluster.Associate(mDevice, 0); + + using requestType = chip::app::Clusters::Identify::Commands::Identify::Type; + using responseType = chip::app::DataModel::NullObjectType; + + chip::app::Clusters::Identify::Commands::Identify::Type request; + request.identifyTime = 0U; + + auto success = [](void * context, const responseType & data) { + (static_cast(context))->OnSuccessResponse_0(); + }; + + auto failure = [](void * context, EmberAfStatus status) { + (static_cast(context))->OnFailureResponse_0(status); + }; + return cluster.InvokeCommand(request, this, success, failure); + } + + void OnFailureResponse_0(uint8_t status) { ThrowFailureResponse(); } + + void OnSuccessResponse_0() { NextTest(); } +}; + class TestOperationalCredentialsCluster : public TestCommand { public: @@ -22739,13 +23956,23 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -22775,6 +24002,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), }; diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp index 37b468853e99c1..e683b5a2af32f9 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp @@ -1910,6 +1910,22 @@ bool emberAfTestClusterClusterTestListInt8UReverseResponseCallback(EndpointId en return true; } +bool emberAfTestClusterClusterTestNullableOptionalResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, + bool wasPresent, bool wasNull, uint8_t value) +{ + ChipLogProgress(Zcl, "TestNullableOptionalResponse:"); + ChipLogProgress(Zcl, " wasPresent: %d", wasPresent); + ChipLogProgress(Zcl, " wasNull: %d", wasNull); + ChipLogProgress(Zcl, " value: %" PRIu8 "", value); + + GET_CLUSTER_RESPONSE_CALLBACKS("TestClusterClusterTestNullableOptionalResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, wasPresent, wasNull, value); + return true; +} + bool emberAfTestClusterClusterTestSpecificResponseCallback(EndpointId endpoint, app::CommandSender * commandObj, uint8_t returnValue) { diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index 0296e3a841e227..e49b0d78b6591c 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -146,6 +146,8 @@ typedef void (*TestClusterClusterTestAddArgumentsResponseCallback)(void * contex typedef void (*TestClusterClusterTestEnumsResponseCallback)(void * context, chip::VendorId arg1, uint8_t arg2); typedef void (*TestClusterClusterTestListInt8UReverseResponseCallback)(void * context, /* TYPE WARNING: array array defaults to */ uint8_t * arg1); +typedef void (*TestClusterClusterTestNullableOptionalResponseCallback)(void * context, bool wasPresent, bool wasNull, + uint8_t value); typedef void (*TestClusterClusterTestSpecificResponseCallback)(void * context, uint8_t returnValue); // List specific responses diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp index c7e7fe53cb346b..34d8865e490364 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp @@ -5434,6 +5434,18 @@ CHIP_ERROR FlowMeasurementCluster::ReadAttributeMaxMeasuredValue(Callback::Cance BasicAttributeFilter); } +CHIP_ERROR FlowMeasurementCluster::ReadAttributeTolerance(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x00000003; + attributePath.mFlags.Set(app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + CHIP_ERROR FlowMeasurementCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { @@ -10469,6 +10481,36 @@ CHIP_ERROR RelativeHumidityMeasurementCluster::ReadAttributeMaxMeasuredValue(Cal BasicAttributeFilter); } +CHIP_ERROR RelativeHumidityMeasurementCluster::ReadAttributeTolerance(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x00000003; + attributePath.mFlags.Set(app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR RelativeHumidityMeasurementCluster::SubscribeAttributeTolerance(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval) +{ + chip::app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = RelativeHumidityMeasurement::Attributes::Tolerance::Id; + attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR RelativeHumidityMeasurementCluster::ReportAttributeTolerance(Callback::Cancelable * onReportCallback) +{ + return RequestAttributeReporting(RelativeHumidityMeasurement::Attributes::Tolerance::Id, onReportCallback, + BasicAttributeFilter); +} + CHIP_ERROR RelativeHumidityMeasurementCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { @@ -11381,6 +11423,36 @@ CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeMaxMeasuredValue(Callback BasicAttributeFilter); } +CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeTolerance(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x00000003; + attributePath.mFlags.Set(app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +CHIP_ERROR TemperatureMeasurementCluster::SubscribeAttributeTolerance(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval) +{ + chip::app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = TemperatureMeasurement::Attributes::Tolerance::Id; + attributePath.mFlags.Set(chip::app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendSubscribeAttributeRequest(attributePath, minInterval, maxInterval, onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TemperatureMeasurementCluster::ReportAttributeTolerance(Callback::Cancelable * onReportCallback) +{ + return RequestAttributeReporting(TemperatureMeasurement::Attributes::Tolerance::Id, onReportCallback, + BasicAttributeFilter); +} + CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { @@ -11693,6 +11765,48 @@ CHIP_ERROR TestClusterCluster::TestNotHandled(Callback::Cancelable * onSuccessCa return err; } +CHIP_ERROR TestClusterCluster::TestNullableOptionalRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t arg1) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + TestCluster::Commands::TestNullableOptionalRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // arg1: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), arg1)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + CHIP_ERROR TestClusterCluster::TestSpecific(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -12532,6 +12646,13 @@ ClusterBase::InvokeCommand, CommandResponseFailureCallback); +template CHIP_ERROR +ClusterBase::InvokeCommand( + const chip::app::Clusters::TestCluster::Commands::TestNullableOptionalRequest::Type &, void *, + CommandResponseSuccessCallback, + CommandResponseFailureCallback); + template CHIP_ERROR ClusterBase::InvokeCommand( const chip::app::Clusters::TestCluster::Commands::TestSpecific::Type &, void *, @@ -13001,6 +13122,33 @@ CHIP_ERROR ThermostatCluster::WriteAttributeMaxCoolSetpointLimit(Callback::Cance return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); } +CHIP_ERROR ThermostatCluster::ReadAttributeMinSetpointDeadBand(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x00000019; + attributePath.mFlags.Set(app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + +template CHIP_ERROR ClusterBase::WriteAttribute( + const chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::TypeInfo::Type & requestData, void * context, + WriteResponseSuccessCallback successCb, WriteResponseFailureCallback failureCb); + +CHIP_ERROR ThermostatCluster::WriteAttributeMinSetpointDeadBand(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int8_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, Thermostat::Attributes::MinSetpointDeadBand::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + CHIP_ERROR ThermostatCluster::ReadAttributeControlSequenceOfOperation(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { @@ -14964,6 +15112,18 @@ CHIP_ERROR WindowCoveringCluster::ReportAttributeSafetyStatus(Callback::Cancelab BasicAttributeFilter); } +CHIP_ERROR WindowCoveringCluster::ReadAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mFieldId = 0x0000FFFC; + attributePath.mFlags.Set(app::AttributePathParams::Flags::kFieldIdValid); + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + CHIP_ERROR WindowCoveringCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) { diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h index 27c639bcb35335..eba6d8ff5ff68d 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h @@ -612,6 +612,7 @@ class DLL_EXPORT FlowMeasurementCluster : public ClusterBase CHIP_ERROR ReadAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); }; @@ -1151,10 +1152,14 @@ class DLL_EXPORT RelativeHumidityMeasurementCluster : public ClusterBase CHIP_ERROR ReadAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t minInterval, uint16_t maxInterval); CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); + CHIP_ERROR SubscribeAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval); + CHIP_ERROR ReportAttributeTolerance(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT ScenesCluster : public ClusterBase @@ -1274,10 +1279,14 @@ class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase CHIP_ERROR ReadAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeMinMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR SubscribeAttributeMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t minInterval, uint16_t maxInterval); CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); + CHIP_ERROR SubscribeAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t minInterval, uint16_t maxInterval); + CHIP_ERROR ReportAttributeTolerance(Callback::Cancelable * onReportCallback); }; class DLL_EXPORT TestClusterCluster : public ClusterBase @@ -1299,6 +1308,8 @@ class DLL_EXPORT TestClusterCluster : public ClusterBase CHIP_ERROR TestListStructArgumentRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t a, bool b, uint8_t c, chip::ByteSpan d, chip::CharSpan e, uint8_t f); CHIP_ERROR TestNotHandled(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR TestNullableOptionalRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t arg1); CHIP_ERROR TestSpecific(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR TestStructArgumentRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t a, bool b, uint8_t c, chip::ByteSpan d, chip::CharSpan e, uint8_t f); @@ -1422,6 +1433,7 @@ class DLL_EXPORT ThermostatCluster : public ClusterBase Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeMaxCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeMinSetpointDeadBand(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeControlSequenceOfOperation(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeSystemMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); @@ -1444,6 +1456,8 @@ class DLL_EXPORT ThermostatCluster : public ClusterBase Callback::Cancelable * onFailureCallback, int16_t value); CHIP_ERROR WriteAttributeMaxCoolSetpointLimit(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, int16_t value); + CHIP_ERROR WriteAttributeMinSetpointDeadBand(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int8_t value); CHIP_ERROR WriteAttributeControlSequenceOfOperation(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t value); CHIP_ERROR WriteAttributeSystemMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, @@ -1660,6 +1674,7 @@ class DLL_EXPORT WindowCoveringCluster : public ClusterBase Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeSafetyStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR WriteAttributeMode(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint8_t value); diff --git a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp index a3458febceb324..aa269a32a2f479 100644 --- a/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/controller-clusters/zap-generated/IMClusterCommandHandler.cpp @@ -5363,6 +5363,73 @@ void DispatchClientCommand(CommandSender * apCommandObj, const ConcreteCommandPa } break; } + case Commands::TestNullableOptionalResponse::Id: { + expectArgumentCount = 3; + bool wasPresent; + bool wasNull; + uint8_t value; + bool argExists[3]; + + memset(argExists, 0, sizeof argExists); + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. + // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. + if (!TLV::IsContextTag(aDataTlv.GetTag())) + { + continue; + } + currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); + if (currentDecodeTagId < 3) + { + if (argExists[currentDecodeTagId]) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + else + { + argExists[currentDecodeTagId] = true; + validArgumentCount++; + } + } + switch (currentDecodeTagId) + { + case 0: + TLVUnpackError = aDataTlv.Get(wasPresent); + break; + case 1: + TLVUnpackError = aDataTlv.Get(wasNull); + break; + case 2: + TLVUnpackError = aDataTlv.Get(value); + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (CHIP_NO_ERROR != TLVUnpackError) + { + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) + { + wasHandled = emberAfTestClusterClusterTestNullableOptionalResponseCallback(aCommandPath.mEndpointId, apCommandObj, + wasPresent, wasNull, value); + } + break; + } case Commands::TestSpecificResponse::Id: { expectArgumentCount = 1; uint8_t returnValue; diff --git a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp index 5be80e2e8875b4..0b26e5581c5ed9 100644 --- a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp +++ b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp @@ -1336,6 +1336,16 @@ CHIP_ERROR FlowMeasurementClusterTest::WriteAttributeMaxMeasuredValue(Callback:: chip::app::AttributePathParams(mEndpoint, mClusterId, FlowMeasurement::Attributes::MaxMeasuredValue::Id), value)); return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); } +CHIP_ERROR FlowMeasurementClusterTest::WriteAttributeTolerance(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, FlowMeasurement::Attributes::Tolerance::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} CHIP_ERROR FlowMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value) { @@ -2359,6 +2369,16 @@ CHIP_ERROR RelativeHumidityMeasurementClusterTest::WriteAttributeMaxMeasuredValu value)); return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); } +CHIP_ERROR RelativeHumidityMeasurementClusterTest::WriteAttributeTolerance(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, RelativeHumidityMeasurement::Attributes::Tolerance::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} CHIP_ERROR RelativeHumidityMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value) @@ -2581,6 +2601,16 @@ CHIP_ERROR TemperatureMeasurementClusterTest::WriteAttributeMaxMeasuredValue(Cal chip::app::AttributePathParams(mEndpoint, mClusterId, TemperatureMeasurement::Attributes::MaxMeasuredValue::Id), value)); return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); } +CHIP_ERROR TemperatureMeasurementClusterTest::WriteAttributeTolerance(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, TemperatureMeasurement::Attributes::Tolerance::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} CHIP_ERROR TemperatureMeasurementClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value) @@ -3724,6 +3754,16 @@ CHIP_ERROR WindowCoveringClusterTest::WriteAttributeSafetyStatus(Callback::Cance chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::SafetyStatus::Id), value)); return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); } +CHIP_ERROR WindowCoveringClusterTest::WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint32_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, WindowCovering::Attributes::FeatureMap::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} CHIP_ERROR WindowCoveringClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value) { diff --git a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h index 5ee90306ad4037..0dc00da4292d70 100644 --- a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h +++ b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h @@ -435,6 +435,8 @@ class DLL_EXPORT FlowMeasurementClusterTest : public FlowMeasurementCluster int16_t value); CHIP_ERROR WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, int16_t value); + CHIP_ERROR WriteAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); CHIP_ERROR WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value); }; @@ -802,6 +804,8 @@ class DLL_EXPORT RelativeHumidityMeasurementClusterTest : public RelativeHumidit uint16_t value); CHIP_ERROR WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value); + CHIP_ERROR WriteAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); CHIP_ERROR WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value); }; @@ -892,6 +896,8 @@ class DLL_EXPORT TemperatureMeasurementClusterTest : public TemperatureMeasureme int16_t value); CHIP_ERROR WriteAttributeMaxMeasuredValue(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, int16_t value); + CHIP_ERROR WriteAttributeTolerance(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); CHIP_ERROR WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value); }; @@ -1157,6 +1163,8 @@ class DLL_EXPORT WindowCoveringClusterTest : public WindowCoveringCluster Callback::Cancelable * onFailureCallback, uint16_t value); CHIP_ERROR WriteAttributeSafetyStatus(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value); + CHIP_ERROR WriteAttributeFeatureMap(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint32_t value); CHIP_ERROR WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value); }; diff --git a/zzz_generated/pump-app/zap-generated/endpoint_config.h b/zzz_generated/pump-app/zap-generated/endpoint_config.h index b468217c0be69c..57ce5551a772bf 100644 --- a/zzz_generated/pump-app/zap-generated/endpoint_config.h +++ b/zzz_generated/pump-app/zap-generated/endpoint_config.h @@ -1002,9 +1002,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ - { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* measured value */ \ - { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* min measured value */ \ - { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* max measured value */ \ + { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \ + { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \ + { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Pressure Measurement (client) */ \ @@ -1020,9 +1020,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ - { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* measured value */ \ - { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* min measured value */ \ - { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* max measured value */ \ + { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* MeasuredValue */ \ + { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinMeasuredValue */ \ + { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxMeasuredValue */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ } diff --git a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h index 0e931ba4de6a06..9f208a7e527c3f 100644 --- a/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h +++ b/zzz_generated/temperature-measurement-app/zap-generated/endpoint_config.h @@ -510,9 +510,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ - { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* measured value */ \ - { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* min measured value */ \ - { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* max measured value */ \ + { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \ + { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \ + { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ } diff --git a/zzz_generated/thermostat/zap-generated/endpoint_config.h b/zzz_generated/thermostat/zap-generated/endpoint_config.h index 8db97412cba36e..4fe350a7a75c92 100644 --- a/zzz_generated/thermostat/zap-generated/endpoint_config.h +++ b/zzz_generated/thermostat/zap-generated/endpoint_config.h @@ -1685,7 +1685,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 383 +#define GENERATED_ATTRIBUTE_COUNT 384 #define GENERATED_ATTRIBUTES \ { \ \ @@ -2002,6 +2002,7 @@ { 0x0016, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(3000) }, /* max heat setpoint limit */ \ { 0x0017, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(1600) }, /* min cool setpoint limit */ \ { 0x0018, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(3200) }, /* max cool setpoint limit */ \ + { 0x0019, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x19) }, /* min setpoint dead band */ \ { 0x001B, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), \ ZAP_SIMPLE_DEFAULT(0x04) }, /* control sequence of operation */ \ { 0x001C, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x01) }, /* system mode */ \ @@ -2066,9 +2067,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ - { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* measured value */ \ - { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* min measured value */ \ - { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* max measured value */ \ + { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \ + { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \ + { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ @@ -2078,9 +2079,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ - { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* measured value */ \ - { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* min measured value */ \ - { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* max measured value */ \ + { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MeasuredValue */ \ + { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinMeasuredValue */ \ + { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxMeasuredValue */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ @@ -2376,86 +2377,86 @@ 0x0103, ZAP_ATTRIBUTE_INDEX(225), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { \ - 0x0201, ZAP_ATTRIBUTE_INDEX(230), 18, 33, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0201, ZAP_ATTRIBUTE_INDEX(230), 19, 34, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(248), \ + ZAP_ATTRIBUTE_INDEX(249), \ 51, \ 337, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(299), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(300), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(303), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(304), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(307), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(308), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(311), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(312), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ { 0x0500, \ - ZAP_ATTRIBUTE_INDEX(315), \ + ZAP_ATTRIBUTE_INDEX(316), \ 6, \ 16, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(321), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(322), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(323), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0504, ZAP_ATTRIBUTE_INDEX(324), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: TV Channel (server) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(327), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(328), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(329), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(330), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(330), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(331), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(332), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(333), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(333), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(334), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(334), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(335), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(337), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(338), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(339), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(340), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(341), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(342), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(349), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(350), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Account Login (server) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(350), 21, 1582, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(351), 21, 1582, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(371), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(372), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(372), \ + ZAP_ATTRIBUTE_INDEX(373), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(374), 5, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(375), 5, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(379), \ + ZAP_ATTRIBUTE_INDEX(380), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2467,7 +2468,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 16, 3347 }, { ZAP_CLUSTER_INDEX(16), 34, 5235 }, { ZAP_CLUSTER_INDEX(50), 3, 10 }, \ + { ZAP_CLUSTER_INDEX(0), 16, 3347 }, { ZAP_CLUSTER_INDEX(16), 34, 5236 }, { ZAP_CLUSTER_INDEX(50), 3, 10 }, \ } // Largest attribute size is needed for various buffers @@ -2477,7 +2478,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (1518) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (8592) +#define ATTRIBUTE_MAX_SIZE (8593) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h index 5ea1c9426fdb33..1910c2487c35cd 100644 --- a/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h +++ b/zzz_generated/tv-casting-app/zap-generated/endpoint_config.h @@ -2009,9 +2009,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ - { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* measured value */ \ - { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* min measured value */ \ - { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* max measured value */ \ + { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MeasuredValue */ \ + { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MinMeasuredValue */ \ + { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* MaxMeasuredValue */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ @@ -2021,9 +2021,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ - { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* measured value */ \ - { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* min measured value */ \ - { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* max measured value */ \ + { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MeasuredValue */ \ + { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MinMeasuredValue */ \ + { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_EMPTY_DEFAULT() }, /* MaxMeasuredValue */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ diff --git a/zzz_generated/window-app/zap-generated/endpoint_config.h b/zzz_generated/window-app/zap-generated/endpoint_config.h index b318a773a43931..61c93da7d56b8d 100644 --- a/zzz_generated/window-app/zap-generated/endpoint_config.h +++ b/zzz_generated/window-app/zap-generated/endpoint_config.h @@ -380,6 +380,16 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, \ + \ + /* Endpoint: 1, Cluster: Window Covering (server), big-endian */ \ + \ + /* 2351 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x01, \ + \ + /* Endpoint: 2, Cluster: Window Covering (server), big-endian */ \ + \ + /* 2355 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x01, \ } #else // !BIGENDIAN_CPU @@ -739,11 +749,21 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, \ + \ + /* Endpoint: 1, Cluster: Window Covering (server), little-endian */ \ + \ + /* 2351 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x01, \ + \ + /* Endpoint: 2, Cluster: Window Covering (server), little-endian */ \ + \ + /* 2355 - FeatureMap, */ \ + 0x00, 0x00, 0x00, 0x01, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (80) +#define GENERATED_DEFAULTS_COUNT (82) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -771,7 +791,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 173 +#define GENERATED_ATTRIBUTE_COUNT 175 #define GENERATED_ATTRIBUTES \ { \ \ @@ -952,6 +972,7 @@ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitTilt */ \ { 0x0017, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x14) }, /* Mode */ \ { 0x001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* SafetyStatus */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2351) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ @@ -980,6 +1001,7 @@ { 0x0013, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFFFF) }, /* InstalledClosedLimitTilt */ \ { 0x0017, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* Mode */ \ { 0x001A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* SafetyStatus */ \ + { 0xFFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(2355) }, /* FeatureMap */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(5) }, /* ClusterRevision */ \ } @@ -1064,13 +1086,13 @@ 0x001D, ZAP_ATTRIBUTE_INDEX(125), 5, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(130), 19, 31, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(130), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(149), 5, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(150), 5, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(154), 19, 31, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(155), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Window Covering (server) */ \ } @@ -1079,7 +1101,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 11, 2418 }, { ZAP_CLUSTER_INDEX(11), 2, 33 }, { ZAP_CLUSTER_INDEX(13), 2, 33 }, \ + { ZAP_CLUSTER_INDEX(0), 11, 2418 }, { ZAP_CLUSTER_INDEX(11), 2, 37 }, { ZAP_CLUSTER_INDEX(13), 2, 37 }, \ } // Largest attribute size is needed for various buffers @@ -1089,7 +1111,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (246) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (2484) +#define ATTRIBUTE_MAX_SIZE (2492) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3)